-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[Grid] Uncentering columns breaks their float #9952
Comments
Here is a super rough way of fixing this, although, we may be able to make this a bit more generic so it applies to all of these types of instances. I'll give it a shot if we think this is a good path to go down.
|
This is probably a bit better. .small-centered {
@include breakpoint(medium) {
&.medium-uncentered {
float: left;
clear: none;
&:last-child:not(:first-child) {
float: right;
clear: none;
}
}
}
@include breakpoint(large) {
&.large-uncentered {
float: left;
clear: none;
&:last-child:not(:first-child) {
float: right;
clear: none;
}
}
}
}
.medium-centered {
@include breakpoint(large) {
&.large-uncentered {
float: left;
clear: none;
&:last-child:not(:first-child) {
float: right;
clear: none;
}
}
}
} |
Sigh... feels like we're going down the specificity rabbit hole... @ncoden do you have any better ideas for how to address this? |
^ Yup. I'm wondering if we should just live with this and be better with specificity in v7. |
Here's what's funny with specificity. You're never resolving problems, just moving them elsewhere, deeper, making them even more difficult to resolve. Take a look at #8990. We had a trouble with We used This is the best solution according to me to avoid all little "specificity bugs" everywhere in usage cases. Keep the specificity low and manually apply classes on HTML tags to modify their behavior instead of relying and global settings (like here) or their parent. So let's deprecate |
@ncoden That plan works for me. |
Hmmm...
So this is not only about incomplete grid alignement, but also to "hide" in the gutter some browsers' precision bug. I found f014bcc that added back this behavior but I don't understand the meaning of the commit message and there is no previous commits. I guess this restore a Grid behavior from Foundation 5 but I'm not sure. I have to find which browsers handle grid precisions differently (IE & Edge maybe, this seems related to #10808 and #10978 could interfere too) to know if we can (or not) remove this behavior. |
Here are the results of my research so far. This precision bug that makes rows in a column not taking the full width (like
I checked how Boostrap works to try to understand how important this is. BS 4 is based on flex grid only (so in most case a row will take all the availaible space), and BS does not resolve this bug (it can be reproduced in their documentation). So now I understand why this "feature" is enabled by default on all columns. In complete rows this is actually a fix. So I don't like to say that but we may have to keep this behavior and go for the specificity fix.... |
…column-9952 fix: fix uncentered last column on Float Grid #9952
…ed-last-column-9952 for v6.5.0 50e7dab fix: fix uncenter for last column in Float Grid foundation#9952 fa07c03 refactor: add "default" position to `grid-column-positioning` to handle float position 9429539 tests: add visual test for Float Grid uncentered columns a8f850e fix: fix last column uncentering with edge align disabled in Float Grid Signed-off-by: Nicolas Coden <[email protected]>
How to replicate:
.large-uncentered
class does not allow columns to float, as the.medium-centered
class still appliesfloat:none;
andclear:both;
https://codepen.io/andycochran/pen/mmyyzj
The text was updated successfully, but these errors were encountered: