-
-
Notifications
You must be signed in to change notification settings - Fork 79k
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
Simplify make-container()
#31735
Simplify make-container()
#31735
Conversation
Maybe rename the variable to |
I don't think so: the value is half the gutter indeed, but we use it directly as a gutter and it's only used in containers. Overriding I'd be in favor of keeping naming as-is, but any other arguments or ideas are welcome :) |
Conceptually, I think we'd leave it as-is. The "gutter" is the combination of one column's right padding and the next column's left padding. We just have to divide it by 2 to apply it to both sides of those different columns. But, if not, would we need to update the bootstrap/scss/mixins/_grid.scss Lines 5 to 13 in 585b3ec
|
I don't think it impacts performance in any way; it should decrease file size a bit, but it's probably not valable for a few bytes only. Your call, IMHO this PR allows simpler override but I don't have any other good argument. |
@mdo FYI in Boosted gutter depends on breakpoint: https://github.com/Orange-OpenSource/Orange-Boosted-Bootstrap/blob/v5-dev/scss/mixins/_container.scss If I kept the current implementation, I'd have to multiply Anyone in need to customize the gutter should redeclare Does my explanations make any sense? |
I can dig it. Should we also do it on the |
FYI this is bigger than the current solution, check the bundlewatch output. Pretty small difference, but still, it doesn't reduce the file size :) |
Ow, I misunderstood what this PR was doing, the "gutter" term confused me a bit ( We should do the division by 2 in our bootstrap/scss/_variables.scss Line 339 in 6c2abf3
To save some bytes, we could also make use of the default value parameter: padding-right: var(--bs-gutter-x, #{$gutter});
padding-left: var(--bs-gutter-x, #{$gutter}); |
What a topic :D Moving the division in our variables seems a good idea. Using the fallback value too, might be turned into a more generic approach about custom properties, we don't need to declare them actually and it'd still allows easy override while being lighter. |
2537d64
to
46a8cd0
Compare
@twbs/css-review so what's the plan here? Should we drop this or is it still valid? |
The current implementation is wrong, as I explained in #31735 (comment). We should fix this one way or another. |
@MartijnCuppens I implemented your suggestions, is there anything else missing? |
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.
Perfect, @ffoodd 👌
This needs a rebase :) |
By dividing by 2 in the custom property directly: 1. code is shorter, 2. a single `stylelint-disable` rule 3. easier override for `padding`s since we only have to change the custom property—without having to think about multiplying what we want by 2. Any thoughts?
…nymous custom props
46a8cd0
to
95c2a7b
Compare
By dividing in the custom property directly:
stylelint-disable
rulepadding
s since we only have to change the custom property—without having to think about multiplying what we want by 2.Any thoughts?