-
Notifications
You must be signed in to change notification settings - Fork 661
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-gaps-1] Initial editor's draft. #10393 #11115
base: main
Are you sure you want to change the base?
Conversation
- Defer out gap decoration areas - Remove direction-relative properties - Flesh out definitions and algorithms - Add examples
Plus minor editorial changes.
I can't remember, was this based on feedback from the working group? |
Formatted version of draft can be found here: https://kbabbitt.github.io/css-gap-decorations/pr-11115/Overview.html |
It was based on feedback from the issue discussion.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great overall, mostly just nits
css-gaps-1/Overview.bs
Outdated
<a>multicol containers</a>, <a>flex containers</a>, and <a>grid containers</a>. | ||
|
||
<a>Gap decorations</a> do not take up space. | ||
That is, the presence or thickness of a <a>gap decoration</a> will not alter the placement of anything else. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is "thickness" the best word here? "dimensions" seems more generic. Or should you use "width" to better align with the properties defined below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For context, this paragraph was copied verbatim from https://drafts.csswg.org/css-multicol-1/#column-gaps-and-rules. But I agree with this and the next couple of suggested changes to the wording, so I'll go ahead and make them.
css-gaps-1/Overview.bs
Outdated
That is, the presence or thickness of a <a>gap decoration</a> will not alter the placement of anything else. | ||
If a <a>gap decoration</a> is wider than its gap, | ||
any adjacent boxes will overlap the decoration, | ||
and in some cases the decoration may possibly extend outside the box of the container. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: "possibly" seems unnecessary
css-gaps-1/Overview.bs
Outdated
and in some cases the decoration may possibly extend outside the box of the container. | ||
<a>Gap decorations</a> are painted just above the border of the container. | ||
For scrollable containers, | ||
note that while the border and background of the container obviously aren't scrolled, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: "obviously" seems unnecessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
css-gaps-1/Overview.bs
Outdated
|
||
A <dfn>gap intersection point</dfn> exists in each of the following locations: | ||
<ul> | ||
<li>The center of an intersection between a gap and the content edge of the container. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should have closing </li>
's
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added throughout.
Name: column-rule-break, row-rule-break | ||
Value: ''intersection'' | ''spanning-item'' | ''none'' | ||
Initial: ''spanning-item'' | ||
Applies to: <a>grid containers</a>, <a>flex containers</a>, <a>multicol containers</a>, and <a>masonry containers</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do these need href
's?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, Bikeshed will generate them automatically, see https://speced.github.io/bikeshed/#autolinking
css-gaps-1/Overview.bs
Outdated
<a>gap intersection points</a> which would normally determine their endpoints. | ||
The initial value of ''50%'' places the <a>gap decoration</a> endpoint in the center of the intersection. | ||
With a value of ''0'', the <a>gap decoration</a> endpoint will coincide with the edge of the intersection. | ||
Negative values may be used to recede from the intersection. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this indicate direction? "...may be used to recede from the intersection in the negative direction", or is that implied with "recede"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed the wording a bit to clarify. In short: a negative value moves the endpoint away from the center of the intersection.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, looks good to me, as well, with a few suggestions below.
Color, style, and width {#color-style-width} | ||
============================================ | ||
|
||
Lists of values and the ''repeat()'' notation {#lists-repeat} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to move this below the definitions for column-rule-* and row-rule-* or is this the order other specs define repeat/list behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://drafts.csswg.org/css-grid-1/#grid-definition places the repeat() definition after the grid-template-* properties but before the shorthands. Changed the ordering in this spec to match.
------------------------------------------------------------------------------ | ||
<pre class='propdef'> | ||
Name: gap-rule-paint-order | ||
Value: row-over-column | column-over-row |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could probably use a visualization
<div class="example"> | ||
The following examples illustrate adjustment of gap decoration endpoints using the 'column-rule-outset' property. | ||
<dl> | ||
<dt><pre>column-rule-outset: 0px;</pre> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might make sense to add 50% as an example since it's the default
css-gaps-1/Overview.bs
Outdated
At an intersection with another gap | ||
<dd> | ||
The <a>crossing gap width</a> is the used value of the 'column-rule-width' | ||
or 'row-rule-width' property, whichever applies to the other gap. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what "the other gap" means here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to "the intersecting gap" - is that clearer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could also change the <dd>
above to "At an intersection with a perpendicular gap" and then change this to "the perpendicular gap." (I was trying to leave room for possible future layouts that have gaps in directions other than vertical or horizontal - for example a hexagonal layout - but could set that aside for now if "perpendicular" would be clearer.)
css-gaps-1/Overview.bs
Outdated
or 'row-rule-width' property, whichever applies to the other gap. | ||
</dl> | ||
|
||
To <dfn>compute the offset</dfn> for a given <a>gap intersection point</a> within a given gap: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is more than one intersection point, right? Does that need to be clarified below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, a given gap will have multiple gap intersection points - at least 2 at each edge of the container, plus 1 anywhere there's an intersection with another gap.
What I'm trying to communicate on this line is that the specific gap intersection point we're talking about is an input to the algorithm below. I'll go back through the algorithms and assign names to the inputs/given values using |...|
to make this clearer.
css-gaps-1/Overview.bs
Outdated
Let |subset| be a list that initially contains only the item removed from |endpoints|. | ||
|
||
<li> | ||
Remove the first item from |endpoints| and add it to the end of |subset|. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Remove the first item from |endpoints|" is mentioned in the item above. Does it only need to be in one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's intentionally in both, though reading the algorithm again I realized I could make it clearer with some edits.
|
||
<pre class='propdef'> | ||
Name: column-rule-break, row-rule-break | ||
Value: ''intersection'' | ''spanning-item'' | ''none'' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these could likely use some sort of visualization
note that while the border and background of the container obviously aren't scrolled, | ||
the decorations need to scroll along with items in the container. | ||
|
||
A <dfn>gap intersection point</dfn> exists in each of the following locations: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could likely use some sort of visualization since I'm struggling to understand how the first is an intersection point
css-gaps-1/Overview.bs
Outdated
<a>multicol containers</a>, <a>flex containers</a>, <a>grid containers</a>, and <a>masonry containers</a> | ||
position child boxes adjacent to each other with gaps, also known as <a>gutters</a>, between them. | ||
Each such gap may contain a <dfn>gap decoration</dfn> which authors | ||
may use to provide a visual separator between adjacent boxes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is "visual separator" the right terminology if gap
is defining the separation. Maybe something that notes it is used to style the gaps instead of as the separator itself?
If so, it might make sense to have a link to the definition of gap
here (but maybe that wouldn't make sense since I don't think multicol has a gap
property)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is "visual separator" the right terminology if gap is defining the separation. Maybe something that notes it is used to style the gaps instead of as the separator itself?
Re-worded this a bit; let me know what you think.
If so, it might make sense to have a link to the definition of gap here (but maybe that wouldn't make sense since I don't think multicol has a gap property)
The "gutter" link is intended to serve this purpose - this is the term defined in css-align-3 and used in the multicol and grid specs.
|
||
<em>This section is not normative.</em> | ||
|
||
[[CSS-MULTICOL-1#column-gaps-and-rules]] allows for rules to be drawn |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we note that this will eventually be deprecated in favor of this specification?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but probably not here since this section is not normative. Added a sentence to the section with the normative property definitions.
@alisonmaher @KurtCattiSchmidt Thanks for the comments! I've pushed some changes with updates to the text; will work on making more visuals. |
Major changes from the unofficial draft:
*-rule-break
to apply to all container typesjoin
keyword from*-rule-outset
and fold its behavior into*-rule-break