-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path_trumps.show-hide.scss
98 lines (69 loc) · 2.28 KB
/
_trumps.show-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
90
91
92
93
94
95
96
97
98
/*------------------------------------*\
Trumps - Show-Hide
\*------------------------------------*/
/**
* Helpers for showing or hiding elements completely
*
* u-hidden-$breakpoint
* Hides an element completely in specified breakpoint
*
* u-visible-$breakpoint
* Renders an element visible in only the specified breakpoint
*
* u-invisible-$breakpoint
* Hides an element visually but maintains its layout and positioning
*
* u-accessibility[-$breakpoint]
* u-visuallyhidden[-$breakpoint]
* Hides an element visually, but keeps it available for screenreaders
*/
@if ($katt-enable-module-trumps-show-hide) {
@each $breakpoint in $breakpoints {
// Get the name of the breakpoint.
$alias: nth($breakpoint, 1);
@if ($katt-enable-show-hide-hidden == true) {
@include media-query($alias) {
.#{$katt-show-hide-namespace}u-hidden-#{$alias} {
display: none !important;
}
}
}
@if ($katt-enable-show-hide-visible == true) {
.#{$katt-show-hide-namespace}u-visible-#{$alias} {
display: none !important;
@include media-query($alias) {
display: block !important;
}
}
}
@if ($katt-enable-show-hide-invisible== true) {
@include media-query($alias) {
.#{$katt-show-hide-namespace}u-invisible-#{$alias} {
visibility: hidden !important;
}
}
}
@if ($katt-enable-show-hide-hidden--accessibility == true) {
/**
* Hide only visually, but have it available for screenreaders:
* http://snook.ca/archives/html_and_css/hiding-content-for-accessibility
*/
@include media-query($alias) {
.#{$katt-show-hide-namespace}u-accessibility-#{$alias},
.#{$katt-show-hide-namespace}u-visuallyhidden-#{$alias} {
@include accessibility-visuallyhidden;
}
}
}
}
@if ($katt-enable-show-hide-hidden--accessibility == true) {
/**
* Also add accessibility and visuallyhidden classes without
* responsive aliases.
*/
.#{$katt-show-hide-namespace}u-accessibility,
.#{$katt-show-hide-namespace}u-visuallyhidden{
@include accessibility-visuallyhidden;
}
}
}