-
Notifications
You must be signed in to change notification settings - Fork 708
[css-grid] [css-grid-2] Manage GRID cell as FLEX (subgrid). #6714
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
Comments
@gregwhitworth @chrisdholt |
As far as I can tell, what you're asking for is already provided by the If you don't know how many items you'll have, and thus don't know how many extra rows/columns might be needed, you can use |
I'm sorry, but you didn't read carefully. |
|
I wanted Excuse me, I use a translator, express your the idea more clearly. I didn't suggest changing the behavior from the container type at all.
In You're talking about meaning. I propose an idea that will allow you to abstract from containers. |
So, returning to your example and diagram above, you basically want the |
Yes |
Interesting idea! But it seems a bit more complex than just extending the Grid with one new feature. Grid was not meant to replace or incorporate Flexbox. They are two different layout tools designed independently for different use cases. Their formatting contexts have different rules. Flexbox is mostly about distributing extra space, Grid is mostly about knowing the placement of each item in advance. Overlapping of grid items placed into the same grid area is intended, it can be useful to prevent layout shifts. Even the same What you propose would be effectively a kind of "super layout" having both formatting contexts simultaneously, Grid rules for some parts and Flexbox rules for some other parts. While this sounds really interesting, opens nearly infinite flexibility, and definitely would have its use cases, it also doesn't look simple, for both implementors and web authors. For authors, it would mean more cognitive load, having to keep in mind both sets of layout rules along with the rules of switching between them. For implementors, it would mean tons of edge cases with potential new bugs. And, to be honest, I'm not sure that there would be that many cases where items of the same hierarchy level would require that different layout rules, and avoiding extra wrappers to group some of them would be that critical. But with all that said, I believe it's totally worth analyzing and experimenting (e.g. with Houdini custom layout). Moreover, we already have kind of precedent: the native Masonry layout, that also tries to combine Grid features with some non-Grid features. |
It is very convenient when the elements are under each other. Yes, very similar to #546 Before writing this idea here, I was sure that this idea had already been considered. Since this idea is logical when developing a GRID after FLEX. |
@SelenIT @Loirooriol @tabatkins But for FLEX, we can supplement. As you can see, we have added a new feature, but at the same time we have made it easier to understand FLEX and GRID by comparing properties. |
Adding support for styles like this
in GRID
We perceive GRID as something more advanced than FLEX.
But if we draw an analogy, we can see that if FLEX is a full-fledged completed embodiment of the idea. Then the GRID is not finished.
There is a proposal to complete the idea of GRID. I propose to make each GRID cell similar to the FLEX markup.
So we need style properties
Appointment:
We use a grid for the site: Header, modules, footer and content.
by setting a position in the grid for each block, we can solve our problems, but only apart from one important problem we have not solved.
If we place several articles in the grid in the content position, then the articles will overlap each other. But the number of articles is an indefinite and unknown quantity in the layout. Today there is 1 news on the site, and tomorrow there is already a lot of news. We are forced to use nested tags. But it happens that nested positions require stretching into several columns.
Or for example, you add a second news block to the page, we do not need to rewrite the layout, we need to create a nesting of blocks. If we can manage each cell as FLEX, then by setting
grid-direction: column;
we will get the ordering of news blocks in one cell.
Do you think it would be useful for you to use the GRID-DIRECTION and GRID-WRAP properties managing each cell as FLEX.?
All these blocks are now arranged in one cell as a column.
I repeat that my idea is to determine the behavior of the blocks by placing them in one grid cell. In one grid cell.
Example
The text was updated successfully, but these errors were encountered: