-
Notifications
You must be signed in to change notification settings - Fork 167
/
_utilities_hide.scss
89 lines (75 loc) · 2.03 KB
/
_utilities_hide.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
@import 'settings';
// mixin for hiding table columns
@mixin vf-hide-table-column {
display: table-cell !important; // override display: none from standard u-hide
opacity: 0 !important;
overflow: hidden !important; // make sure content doesn't overflow
padding: 0 !important;
white-space: nowrap !important; // prevent content from wrapping in 0 width column
width: 0 !important;
}
// Hide elements with explicit breakpoints
@mixin vf-u-hide {
.u-hide-text {
@extend %vf-hide-text;
}
// mixin for hiding using display none (for all breakpoints)
.u-hide {
display: none !important;
&--small {
@media (max-width: $breakpoint-small - 1) {
display: none !important;
}
}
&--medium {
@media (min-width: $breakpoint-small) and (max-width: $breakpoint-large - 1) {
display: none !important;
}
}
&--large {
@media (min-width: $breakpoint-large) {
display: none !important;
}
}
}
// stylelint-disable selector-max-type -- table elements can use selector types
td.u-hide,
th.u-hide {
@include vf-hide-table-column;
&--small {
@media (max-width: $breakpoint-small - 1) {
@include vf-hide-table-column;
}
}
&--medium {
@media (min-width: $breakpoint-small) and (max-width: $breakpoint-large - 1) {
@include vf-hide-table-column;
}
}
&--large {
@media (min-width: $breakpoint-large) {
@include vf-hide-table-column;
}
}
}
// stylelint-enable selector-max-type
// expanding table uses flex layout, so use standard u-hide for it
.p-table--expanding .u-hide {
display: none !important;
&--small {
@media (max-width: $breakpoint-small - 1) {
display: none !important;
}
}
&--medium {
@media (min-width: $breakpoint-small) and (max-width: $breakpoint-large - 1) {
display: none !important;
}
}
&--large {
@media (min-width: $breakpoint-large) {
display: none !important;
}
}
}
}