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

Move .col-* classes to same media query after .row-cols-* classes #34341

Closed
wants to merge 1 commit into from

Conversation

mdo
Copy link
Member

@mdo mdo commented Jun 23, 2021

Fixes #34335.

@mdo mdo requested a review from a team as a code owner June 23, 2021 19:58
Copy link

@danielkauffman danielkauffman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes #34335 awesome!

CodePen showing the issue in v5.0.2: https://codepen.io/rocksolidsolutions/pen/zYZVeeq

CodePen showing the fix in this branch: https://codepen.io/rocksolidsolutions/pen/qBrzgKq

Building the dist files and running git diff v5.0.1 -- dist/css/bootstrap-grid.css and git diff v5.0.2 -- dist/css/bootstrap-grid.css both seem okay.

I suppose it would be good to check that #33621 is still fixed after this change.

Copy link

@danielkauffman danielkauffman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per @lacutah #33530 expects row-cols* to override col. I theoretically like the cleanliness of having all of the row-cols* declarations together and all of the col declarations together (as with this PR) but doing so either breaks cols row-cols or breaks col-N col-breakpoint. I'm not sure how widespread each of these use cases are. But the simple solution (assuming both cases need to be supported) seems to be ordering the declarations first col then row-cols* then col-breakpoint*.

@ffoodd
Copy link
Member

ffoodd commented Jun 29, 2021

I agree with @danielkauffman here. We have an issue with this PR regarding .col (without breakpoint): see #33621 CodePen using this PR's CSS to reproduce.

.col should always be first, and .col-* last.

@@ -92,6 +87,11 @@
$infix: breakpoint-infix($breakpoint, $breakpoints);

@include media-breakpoint-up($breakpoint, $breakpoints) {
// Provide basic `.col-{bp}` classes for equal-width flexbox columns
.col#{$infix} {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO we should skip if $infix is empty, and prefer to set .col before any loop. Maybe hard-coded in our main grid file, maybe?

@mdo
Copy link
Member Author

mdo commented Jul 28, 2021

Punting on this for #34612 right now.

@mdo mdo closed this Jul 28, 2021
@mdo mdo deleted the fix-col-auto-classes branch July 28, 2021 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v5.0.2 regression: grid col-N now overrides col-breakpoint
4 participants