Will v5 include breakpoint CSS variables? #33337
Unanswered
thelevicole
asked this question in
Q&A
Replies: 2 comments 1 reply
-
Just to add that for the time being, because I compile bootstrap source sass I've added the below to my project... :root {
@each $key, $value in $grid-breakpoints {
--bs-breakpoint-#{$key}: #{$value};
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
We pulled it because they cannot be used in media queries and it feels a little disingenuous in that regard. But, the JS angle is interesting for sure. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In v4 we have access to the breakpoints values via CSS variables:
As documented here: https://getbootstrap.com/docs/4.6/getting-started/theming/#css-variables
But after using v5 and reading the docs, these do not appear to exist in the current v5 beta2. See here: https://getbootstrap.com/docs/5.0/customize/css-variables/
The documentation does mention breakpoints and more coming soon...
So my question is, will they be added in a future release?
I ask because I like to uses these variables in javascript. For example:
Even better, it would be cool if these were added to the bootstrap javascript API. I started implementing something similar for v4 https://thelevicole.com/breakpoints.js/ but needs a lot of work.
Beta Was this translation helpful? Give feedback.
All reactions