forked from ionic-team/ionic-framework
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(css): add CSS display utilities (ionic-team#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 ionic-team#10904
- Loading branch information
1 parent
d1ebf61
commit a157e2f
Showing
3 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
@import "./text-alignment"; | ||
@import "./text-transformation"; | ||
@import "./flex-utils"; | ||
@import "./display"; |