Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

embedded all the flex examples in the page and removed all the images… #37232

Closed
wants to merge 6 commits into from

Conversation

dletorey
Copy link
Contributor

Description

  • moved the flexbox examples into the page
  • deleted unused images

Motivation

  • Helping @bsmth with the migration of examples into content

@dletorey dletorey requested a review from a team as a code owner December 16, 2024 17:32
@dletorey dletorey requested review from estelle and bsmth and removed request for a team and estelle December 16, 2024 17:32
@github-actions github-actions bot added Content:Learn:CSS Learning area CSS docs size/l [PR only] 501-1000 LoC changed labels Dec 16, 2024
Copy link
Contributor

github-actions bot commented Dec 16, 2024

Preview URLs

(comment last updated: 2024-12-18 12:33:21)

One issue that arises when you have a fixed width or height in your layout is that eventually your flexbox children will overflow their container, breaking the layout. Have a look at our [flexbox-wrap0.html](https://github.com/mdn/learning-area/blob/main/css/css-layout/flexbox/flexbox-wrap0.html) example and try [viewing it live](https://mdn.github.io/learning-area/css/css-layout/flexbox/flexbox-wrap0.html) (take a local copy of this file now if you want to follow along with this example):
One issue that arises when you have a fixed width or height in your layout is that eventually your flexbox children will overflow their container, breaking the layout. In the following example we have 12 {{htmlelement("section")}}s, which don't fit so there is a horizontal scroll.

```html hidden live-sample___flex-wrap_0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies for the drive-by, but I think this is a usability regression. In the current page there's a link to the complete source, so anyone can look at it, copy it, play with it etc. And the GitHub browser is a reasonable way of browsing source code.

In this version a user can't see this code and isn't presented with a link to it. Yes, they can see the code if they click "Play", but it's still not a good experience: the HTML is 125 lines long, and in the Play editor they can only see 6 lines at a time, it's just not possible to get an overview of what the code is doing.

In general I think hidden is a dangerous attribute to use in examples, for this reason. Users see the result, but they can't see the code that makes that result work.

Although I know GH live samples have some issues of their own, I think in cases like this, where the code is quite long, it's probably the best choice as far as users are concerned.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While moving these examples I did find myself discussing this in my own head too.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would be quite cool would be if normal live samples could use external JS/CSS/HTML sources. Then, say, you could put something like flex-wrapping.html next to your index.md, and include a link to it (just like https://github.com/mdn/learning-area/blob/main/css/css-layout/flexbox/flexbox-wrap0.html but in /content), so people could see it in GitHub, but there would still only be one copy of the source, inside content.

@github-actions github-actions bot added the merge conflicts 🚧 [PR only] label Dec 19, 2024
Copy link
Contributor

This pull request has merge conflicts that must be resolved before it can be merged.

@dletorey
Copy link
Contributor Author

dletorey commented Jan 6, 2025

Replaced by PR #37523

@dletorey dletorey closed this Jan 6, 2025
@dletorey dletorey deleted the flexbox-examples-work branch January 6, 2025 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:Learn:CSS Learning area CSS docs merge conflicts 🚧 [PR only] size/l [PR only] 501-1000 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants