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

[css-line-grid] simplification to line-grid level 1 #880

Open
frivoal opened this issue Jan 10, 2017 · 0 comments
Open

[css-line-grid] simplification to line-grid level 1 #880

frivoal opened this issue Jan 10, 2017 · 0 comments

Comments

@frivoal
Copy link
Collaborator

frivoal commented Jan 10, 2017

One of the major source of complexity of the line grid is that in some cases, it can make the position depend on the size AND the size depend on the position, or (equivalently?) that it can make the intrinsic size depend on the position.

For example, if you create the grid on a vertical flexbox, and snap to the grid in the flex items, you're in trouble. Because of flexbox, the position of the various items depends on their size. But because of the line grid snapping, their size depends on their position.

Not all use cases for line grid depend on this problem being solved, but there are a number of use cases that do. For instance, using line-grid and grid together is desirable, and runs into the same issues. So we should solve it. At the same time, this is currently a large gap in the spec, and a big chunk of complexity that implementors are not enthusiastic about tackling immediately. So it would be good if we could solve that part later.

Here is a proposal to simplify line-grid for level 1 in a way which postpones this problem, while being completely compatible with the current definition so that we can reintroduce it in level 2 when we're ready to tackle the complexity.

  1. add an auto value to the line-grid property, and make it the initial value. It does the same as match-parent on all elements, except elements that establish a BFCs where it would instead do the same as create

  2. In level 1, remove the explicit match-parent value (but keep the behavior, since it is invoke by auto on most elements).

  3. In level 2, bring back match-parent, and define how to resolve the cases where that makes size and position interdependent.

As far as I can tell, this is enough make sure that you never have situations (in level 1) where the size depends on the position AND the position depends on the size.

The simplification comes from part 2 but we need part 1 to keep the line-grid usable without the explicit match-parent value.


Side point: Even if an implementer was willing to bite the bullet and solve the interdependency problem now, I think the addition of the auto value would still be useful. In many cases it will create the grid on the right element without the author having to use the line-grid property manually, making it possible to merely use the line grid with the line-snap property without having to bother defining it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant