-
-
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
replace .visible-{size} with .visible-{size}-{display} #12204
Conversation
Perhaps make it more clear in the docs that you can now use any of these classes to toggle table elements? |
This is really verbose. Why not use new mixins for just the inline and inline-block variations? How often will you see any table related element go from inline to table, or table to inline? Don't see those mixing that often. |
I think I'd rather wait to do this until v3.2 given we've only a few days left for v3.1. |
@mdo This has now been revised accordingly to exclude the table-related special casing. |
Nice. Are we deprecating the generic classes then? Should we mention that in the docs and downplay that? |
Yes; at least, that's what I'm proposing.
Yes, fair point. I'll further tweak the PR. |
Okay, the deprecations are now mentioned in the docs. |
Don't the |
IMHO, no. We'll merely be able to simplify those classes to not be defined using the mixin in v4, but their semantics should be unaffected except possibly in some very obscure edge cases. |
I see and agree, thanks for explaining. Is this perhaps suitable for inclusion in 3.1.0 after all? Seems it's all set except for a rebase? Don't wanna rush anything though... :) |
Rebase complete :-) |
⭐⭐⭐⭐⭐ ;) |
Okay, the unrelated fix that made the classes chainable also made my changes not merge anymore, but I've now pushed a revised version. |
Word, I'll peep this again soon. |
@cvrebert Is there something to update here regarding recent or conflicting changes? |
@mdo No conflicts, but I've just rebased this again so that Travis will turn green. Just needs QA+review. |
Thinking ahead more, I have two questions:
|
IMHO FWIW:
(This PR doesn't comply with all these goals.) |
@cvrebert: I have a menu where I display normal texts on xs and lg screens, and short texts on sm and md screens. So I needed to use both show and hide classes. |
can't the .visible-{screen size} be left as it is and only the -inline and -inline-block be added. |
What about adding a class for setting the For example: And the CSS:
I'm pretty sure no one will need to display a block as With this class, backwards compatibility won't be broken. |
@alexislefebvre We avoid chained classes in Bootstrap whenever possible. |
replace .visible-{size} with .visible-{size}-{display}
💎💎💎💎💎💎💎💎💎💎🚢💎💎💎💎💎💎💎💎💎 |
After ASCII art now comes Emoji art; It's great, I love it! |
I would like to point out another solution (below). It maintains existing syntax and works with any type of element, as it does not change the CSS display property except when hiding the element. However, it requires IE9+, so may only be useful when IE8 compatibility is dropped. @media (max-width: 767px) {
.visible-sm:not(.visible-xs),
.visible-md:not(.visible-xs),
.visible-lg:not(.visible-xs) {
display: none !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.visible-xs:not(.visible-sm),
.visible-md:not(.visible-sm),
.visible-lg:not(.visible-sm) {
display: none !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.visible-xs:not(.visible-md),
.visible-sm:not(.visible-md),
.visible-lg:not(.visible-md) {
display: none !important;
}
}
@media (min-width: 1200px) {
.visible-xs:not(.visible-lg),
.visible-sm:not(.visible-lg),
.visible-md:not(.visible-lg) {
display: none !important;
}
} |
Adds
.visible-{screen size}-block
,.visible-{screen size}-inline
, and.visible-{screen size}-inline-block
classes (and also a corresponding trio for.visible-print
). Also deprecates the.visible-{screen size}
classes.Proposed fix for #8869 pursuant to #9397. Includes docs updates.
There is most likely a way to refactor this to be less repetitive & more concise by using some more sophisticated Less features, but this should be okay for the time being.
/to @mdo for review.