-
Notifications
You must be signed in to change notification settings - Fork 680
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-multicol] image support for column rules #5080
Comments
Agree with using the border-image model as a basis. But I think we should figure out how it's going to work with an intersected grid (#2748) before finalizing on anything, since we don't want to come up with something here that won't be exactly portable to Grid. |
The working group discussed this today, and decided to keep the discussion going here and in #2748 to see how this would work with grid Topic: [css-multicol] image support for column rules |
I was playing a bit more with the thought of how intersections could be handled. I did so from a design point of view. Once all questions are clarified, I'm happy to express this in syntax form. Here's what I came up with so far:
ExamplesI have created some mockups to illustrate the different types of extents. The colors and patterns are just for illustration purposes, so please bare with me! Some general notes on them: All the examples paint the horizontal rules above the vertical ones and their middle part is repeated. Extend up to center of gapGrid layout, no outer extent: Masonry/Flexbox layout, no outer extent: Extend up to edge of segmentGrid layout, no outer extent. Extend over whole contentGrid layout, no outer extent. Extend over whole content boxGrid layout. Open questions
I surely missed a few questions. So please let me know when there are more things that need clarification. Sebastian |
Additional Questions
Or in the case where you want it only on a single item in the row:
Or in between two items:
Or for another example:
Sebastian, to your point:
Could this be determined by setting a z-index value? |
I guess @MatsPalmgren's suggested border-image-like representation clips wider images to the gap area. Though that would be influenced by
I am not totally sure regarding some of those questions, but I think all of them rather go in the direction of being able to style grid areas, which is discussed in #4416, and not the gaps.
That could be achieved by having the alignment within the image, but what are the use cases for different alignments than centering?
Using subgrids I'd say so, though it needs to be defined how they behave.
Regarding those examples, it seems to be a question of whether to always draw the rules or only between items. And I agree that both may have use cases. One use case for a having the rules be drawn when they don't have adjacent content can be seen at https://sea-visualcommunication.design/uploads/9/8/6/6/98662420/cn-07112018-a01_orig.jpg.
To be able to set a Sebastian |
Using Sebastian Zartner's diagrams of grid line intersection options, @mirisuzanne and I sketched out a few syntax proposals which we posted in #2748. See #2748 (comment) Putting it all together, we'd have the following syntaxes for gap styling (with row-/column-/unprefixed variants for each):
What do people think? |
@SebastianZ @fantasai I've posted a concrete proposal for this feature in #6748 which includes image support and other features discussed in #2748. I'd love to hear your feedback on that. I didn't see @fantasai's proposal above until now, but I think it should cover those cases and more... |
@MatsPalmgren Thank you for creating the concrete proposal and the prototype implementation! That's really awesome! I'll provide more feedback in #6748 once I had the time to read it more carefully. Sebastian |
@fantasai @mirisuzanne Thank you for your syntax proposal, as well! It looks really promising. I'll provide more general feedback in #2748. Though I have a one note regarding the image support. I feel like So could
Sebastian |
border-image uses a 9-slice to give you complete control over all the relevant changeable areas - the four corners, and the four stretchable/repeatable sides. Using these 8 areas, you can do fancy things like scrollwork; the syntax was explicitly designed to allow these sort of uses. But rules in a grid have a different set of areas - they've got only two stretchable/repeatable bits (horizontal and vertical), but seventeen possible fixed images - the four endcaps (top, bottom, left, right), then the four 1-way intersection, the four 2-way intersections, the four 3-way intersections, and the single 4-way. Only using 6 regions (row-* and column-* each specifying 3) doesn't account for any of the intersection areas. We do have the advantage that all the missing intersection regions are the same size, so specifying them is potentially relatively easy, with a separate image that gets implicitly sliced into 13 regions (4 1-way, 4 2-way, 4 3-way, 1 4-way). We can just say they must be stacked vertically, for instance. This would be provided by a separate property from the row-gap-image and column-gap-image; if it wasn't specified, you would just overlay the repeat bit of the row and column images in some way. I also don't think we need the full complexity of border-image. It's designed in a slightly funky way to deal with the fact that border-width is layout-affecting, but the border-image might want to be smaller or larger than that border region, and extend both further in or further out than the inner/outer border edges. Gaps have a much simpler sizing model to deal with. On the other hand, we have a physical/logical mismatch with gaps that doesn't exist with borders. Borders are specified physically (you can now use logicals, but physical is always an option) and the border-image directions are physical as well. But gaps are inherently logical; we'd have to autorotate images to make that work, which is (a) somewhat weird, and (b) favors one orientation as the "default"; vertical writing modes would have to author a "sideways" image which is then rotated into the actually-used orientation. Both of these suggest that we actually need do something relatively different from border-image to get gap images. Here's an initial sketch:
The
The These interact with the existing+proposed gap-rule properties:
I think, then, that the endcap images are used against breaks, with the mid image between them. When gaps intersect without a break, the mid image goes up to the edge of the intersection, and the appropriate (Ugh, I didn't consider that intersection areas can overlap in flexbox and masonry. Not sure what to do about that. Maybe they just plain overlap, and you shouldn't use images that would look bad in that situation when using masonry or flexbox gap images.) (If you only use a gap image in one axis (x or y, not both), then I think we only use the cross images when you'd trigger a skip in that axis. Otherwise we just stretch across the intersection area. That is, consider a horizontal multiline flexbox. With an Gap images are always centered in the appropriate way; horizontal/vertically for the |
From the discussion in #2748 it seems that image support for column rules is a requested feature.
I propose to add three new properties to support that:
column-rule-image-source: none | <image>
column-rule-image-slice: [<number [0,∞]> | <percentage [0,∞]>]{1,2}
for slicing the image into three regions. The initial value,0
, makes the whole image fill the rule area as specified bycolumn-rule-image-repeat
. A non-zero value defines an area at the start/end of the rule area that isn't stretched (as demonstrated in the testcase below).column-rule-image-repeat: stretch | repeat | round | space
Here's a testcase demonstrating these properties. And here's a video of how it would render.
I think we can start with these properties for now and consider
column-rule-image-width/outset
at a later stage. They seem less important and I'd prefer to look at thecolumn-rule-extent
/column-rule-inset
in #2748 first, in case those might affect the decision/design.(If we decide to add
row-rule-*
properties in #2748 then these three properties should also be added in that axis of course.)Fwiw, the above three properties should be fairly easy to implement in UAs that already support the corresponding
border-image-*
properties since you can leverage existing rendering code for those.The text was updated successfully, but these errors were encountered: