mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 00:27:41 +08:00
feat(css): add CSS display utilities (#17359)
Adds classes to set display none on any element.
* add `.ion-hide` selector to hide content
* add `.ion-hide-{breakpoint}-{up|down}]` to selectively hide content
closes #10904
This commit is contained in:
committed by
Brandy Carney
parent
3b331b5216
commit
6bea9d3248
31
core/src/css/display.scss
Normal file
31
core/src/css/display.scss
Normal file
@ -0,0 +1,31 @@
|
||||
@import "../themes/ionic.globals";
|
||||
@import "../themes/ionic.mixins";
|
||||
|
||||
// Display
|
||||
// --------------------------------------------------
|
||||
// Modifies display of a particular element based on the given classes
|
||||
|
||||
.ion-hide {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
// Adds hidden attributes
|
||||
@each $breakpoint in map-keys($screen-breakpoints) {
|
||||
$infix: breakpoint-infix($breakpoint, $screen-breakpoints);
|
||||
|
||||
@include media-breakpoint-up($breakpoint, $screen-breakpoints) {
|
||||
// Provide `ion-hide-{bp}-up` classes for hiding the element based
|
||||
// on the breakpoint
|
||||
.ion-hide-#{$infix}-up {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
@include media-breakpoint-down($breakpoint, $screen-breakpoints) {
|
||||
// Provide `ion-hide-{bp}-down` classes for hiding the element based
|
||||
// on the breakpoint
|
||||
.ion-hide-#{$infix}-down {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user