-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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: Add a debugger class. #40976
base: main
Are you sure you want to change the base?
CSS: Add a debugger class. #40976
Changes from all commits
833be9f
186bda9
394b161
f58c9c5
76449ba
f7b15cd
faab259
129115f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
@if $enable-debugger-classes { | ||
%grid-debug { | ||
position: relative; | ||
|
||
&::before { | ||
position: absolute; | ||
top: 0; | ||
right: 0; | ||
bottom: 0; | ||
left: 0; | ||
z-index: 1999; | ||
pointer-events: none; | ||
content: ""; | ||
background: repeating-linear-gradient(to right, transparent, transparent calc(var(--#{$prefix}gutter-x) * .5), var(--#{$prefix}primary) calc(var(--#{$prefix}gutter-x) * .5), var(--#{$prefix}primary) calc((100% - 12 * var(--#{$prefix}gutter-x)) / 12 + var(--#{$prefix}gutter-x) * .5), transparent calc((100% - 12 * var(--#{$prefix}gutter-x)) / 12 + var(--#{$prefix}gutter-x) * .5), transparent calc(100% / 12)); // stylelint-disable-line function-disallowed-list | ||
opacity: .3; | ||
} | ||
} | ||
|
||
.#{$prefix}debug-grids { | ||
&::before { | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
z-index: 2000; | ||
padding: .5em 1em; | ||
font-family: $font-family-base; | ||
color: $black; | ||
background-color: $white; | ||
border-radius: 0 0 4px; // stylelint-disable-line property-disallowed-list | ||
@include font-size(var(--#{$prefix}debug-label-font-size, $h1-font-size)); | ||
} | ||
|
||
@each $breakpoint, $value in $grid-breakpoints { | ||
@include media-breakpoint-up($breakpoint) { | ||
&::before { | ||
content: "#{$breakpoint}"; | ||
} | ||
} | ||
} | ||
|
||
[class^="container"], | ||
&[class^="container"], | ||
.row, | ||
&.row { | ||
@extend %grid-debug; | ||
} | ||
} | ||
|
||
.#{$prefix}debug-grid-cols { | ||
@extend %grid-debug; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -383,6 +383,7 @@ $enable-validation-icons: true !default; | |
$enable-negative-margins: false !default; | ||
$enable-deprecation-messages: true !default; | ||
$enable-important-utilities: true !default; | ||
$enable-debugger-classes: true !default; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. default value looks There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep, it's done on purpose at the moment to be able to test it on the deploy preview but I think it will go to |
||
|
||
$enable-dark-mode: true !default; | ||
$color-mode-type: data !default; // `data` or `media-query` | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
$enable-debugger-classes: true !default; | ||
|
||
@import "functions"; | ||
@import "variables"; | ||
@import "mixins"; | ||
|
||
@import "debug"; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,5 +58,6 @@ $utilities: map-get-multiple( | |
"padding-start", | ||
) | ||
); | ||
@import "debug"; | ||
|
||
@import "utilities/api"; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,7 @@ | |
|
||
// Helpers | ||
@import "helpers"; | ||
@import "debug"; | ||
|
||
// Utilities | ||
@import "utilities/api"; | ||
|
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.
Can you provide this functionality as a seperated class name?
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.
Why not, I don't have strong opinion on this. I did it this way because on my project, we use sometimes
.row
and sometimes.container-*
with.col-*
inside. Do you have any cool name to propose ?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 feature looks nice but the developer may want to toggle on/off this option to make the design look more clear and understandable.
You know, design considerations call for pixel-perfect work, and the overlay of this option can become annoying at some point.
.bs-debug-grid-marks
,.bs-debug-grid-cols
or something else like to understand of the purpose this utility.It would be better if it does not have any connection with the other class name. The developer can use whatever he/she wants like
<body class="bs-debug-grid-breakpoints bs-debug-grid-marks">