-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
visibility-display.scss
123 lines (104 loc) · 2.38 KB
/
visibility-display.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
// Visibility and display utilities
// Responsive display utilities
@each $breakpoint, $variant in $responsive-variants {
@include breakpoint($breakpoint) {
@each $display in $display-values {
.d#{$variant}-#{$display} { display: $display !important; }
}
}
}
.v-hidden { visibility: hidden !important; }
.v-visible { visibility: visible !important; }
// Hide utilities for each breakpoint
// Each hide utility only applies to one breakpoint range.
@media (max-width: $width-sm - 0.02px) {
.hide-sm {
display: none !important;
}
}
@media (min-width: $width-sm) and (max-width: $width-md - 0.02px) {
.hide-md {
display: none !important;
}
}
@media (min-width: $width-md) and (max-width: $width-lg - 0.02px) {
.hide-lg {
display: none !important;
}
}
@media (min-width: $width-lg) {
.hide-xl {
display: none !important;
}
}
// Show/Hide Viewport range utilities
.show-whenNarrow,
.show-whenRegular,
.show-whenWide,
.show-whenRegular.hide-whenWide {
display: none !important;
}
.hide-whenNarrow,
.hide-whenRegular,
.hide-whenWide {
display: block !important;
}
@media (max-width: $width-md - 0.02px) {
.show-whenNarrow {
display: block !important;
}
.hide-whenNarrow {
display: none !important;
}
}
@media (min-width: $width-md) {
.show-whenRegular,
.show-whenRegular.hide-whenWide {
display: block !important;
}
.hide-whenRegular {
display: none !important;
}
}
// The width of a `wide` viewport range may change as we're finalizing
// the Primer primitives viewport ranges proposal
@media (min-width: $width-xl) {
.show-whenWide {
display: block !important;
}
.hide-whenWide,
.show-whenRegular.hide-whenWide {
display: none !important;
}
}
/* Set the table-layout to fixed */
.table-fixed { table-layout: fixed !important; }
// Only display content to screen readers
//
// See: http://a11yproject.com/posts/how-to-hide-content/
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
// Workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=1241631
word-wrap: normal;
border: 0;
}
// Only display content on focus
.show-on-focus {
position: absolute;
width: 1px;
height: 1px;
margin: 0;
overflow: hidden;
clip: rect(1px, 1px, 1px, 1px);
&:focus {
z-index: 999;
width: auto;
height: auto;
clip: auto;
}
}