-
-
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
Responsive display utilities #20934
Responsive display utilities #20934
Conversation
… has no breakpoint modifier in the class name
I like this idea! +1 |
Don't like this idea - BS could really use a built-in breakpoint that will handle the transition between portrait and landscape mode on a mobile device. PLEASE add |
Makes total sense. |
@andyl This isn't about what the breakpoints are. This is about adding responsive display utility classes and perhaps negating the Edit: To be clear, the |
Yeah, that's the idea @saviomd. |
As a comparison, here's the float utils already in .float-xs-left {
float: left !important;
}
.float-xs-right {
float: right !important;
}
.float-xs-none {
float: none !important;
}
@media (min-width: 576px) {
.float-sm-left {
float: left !important;
}
.float-sm-right {
float: right !important;
}
.float-sm-none {
float: none !important;
}
}
@media (min-width: 768px) {
.float-md-left {
float: left !important;
}
.float-md-right {
float: right !important;
}
.float-md-none {
float: none !important;
}
}
@media (min-width: 992px) {
.float-lg-left {
float: left !important;
}
.float-lg-right {
float: right !important;
}
.float-lg-none {
float: none !important;
}
}
@media (min-width: 1200px) {
.float-xl-left {
float: left !important;
}
.float-xl-right {
float: right !important;
}
.float-xl-none {
float: none !important;
}
} |
Visually prefer to keep -xs |
For consistency in naming, I would argue that leaving |
If it starts on zero I think that no makes any sense to have the xs prefix, I agree with this idea 👍 |
For the sake of clarity and consistency, I really like the xs-. It was a bit of an adjustment, coming from v3, but it only takes a few minutes to get used to it. In my opinion something about using xs- feels semantically nice. |
I think it's a good idea. No breaking point it's like the default value. So using |
@mdo I've been using this approach for couple of years and its been working great. It gives a lot of flexibility as you always start with default class name (breakpoint agnostic) and then override as you go up. Go for it! |
I fully support this. As I've been developing v4 sites. Remembering to put -xs in there for a default value to apply to every breakpoint has been hard to remember |
As @maximebeaudoin said "BS is mobile first so all default css should affect the smallest device first" and continue up. |
for all sides... a or not a ? Personally I prefer {abbrev}{sides}-{breakpoint}-{size} even for "all" but both are logical. |
keeping as a rule xs md lg etc .. would be nice but in the same time why waste time to write xs when you can just do d-none instead of d-xs-none was even a bit hard to write :-). should flip a coin guys =D because this goes as a 50 - 50% :)) |
@mdo wouldn't it be better to have "up" and "down" modifiers?
|
Heads up, I've updated this PR to also include the same changes to the |
|
This explores adding responsive display utilities, replacing the static
inline
,inline-block
, andblock
options we have currently. The twist here though is that the lowest breakpoint doesn't have a breakpoint abbreviation in the class name.Here's an example of what I mean with just the
display: none
utility:I'm exploring this since the lack of
xs
could make it an easier transition to v4 for those who used the v3 utilities. Plus it's a bit more accurate to what's happening in the compiled CSS since there's no media query around those styles.Thoughts?