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

[FEATURE] Improved Visibility styles for responsive design #429

Closed
wants to merge 7 commits into from
Closed
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions ui/utilities/visibility/flavors/responsive/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,32 @@
@include visibility(small, $mq-small, $mq-medium);
@include visibility(medium, $mq-medium, $mq-large);
@include visibility(large, $mq-large);

// Generates responsive visibility tags
@each $key, $value in (
'x-small': $mq-x-small,
'small': $mq-small,
'medium': $mq-medium,
'large': $mq-large,
'x-large': $mq-x-large,
) {
@media(min-width: $value) {
// [EXAMPLE] slds-hide--medium:
// HIDES the element when window is BIGGER than medium.
// element will be displayed normaly when window is smaller.
.slds-hide--#{$key} {
// !important is required to increase specificity
display: none!important;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

! should be preceded by a space, and should not be followed by a space
!important should not be used

}
}

@media(max-width: $value - 1px) {
// [EXAMPLE] slds-show--medium:
// HIDES the element when window is SMALLER than medium.
// element will be displayed normaly when window is bigger.
.slds-show--#{$key} {
// !important is required to increase specificity
display: none!important;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

! should be preceded by a space, and should not be followed by a space
!important should not be used

}
}
}