Skip to content
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

feat(css): add CSS display utilities #17359

Merged
merged 14 commits into from
Feb 22, 2019
Merged
3 changes: 2 additions & 1 deletion core/.stylelintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ ignoreFiles:
- src/css/flex-utils.scss
- src/css/normalize.scss
- src/css/text-alignment.scss
- src/css/display.scss
- src/components/slides/slides-vendor.scss
- src/themes/ionic.mixins.scss
- src/themes/ionic.functions.color.scss
Expand Down Expand Up @@ -272,4 +273,4 @@ rules:
- transform-origin

string-quotes:
- double
- double
31 changes: 31 additions & 0 deletions core/src/css/display.scss
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;
}
}
}
1 change: 1 addition & 0 deletions core/src/css/utils.bundle.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
@import "./text-alignment";
@import "./text-transformation";
@import "./flex-utils";
@import "./display";