-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_toggled-display.scss
executable file
·45 lines (38 loc) · 1.12 KB
/
_toggled-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
// https://github.com/sanderaarts/scss-utils/_toggled-display.scss
// toggled-display
//
// Define basic toggled display (expand/collapse).
// Assumes the following DOM (elements are all siblings):
//
// <input id="%ID%" class="{$type}-toggle" type="checkbox">
// <label for="%ID%">%TOGGLE_LABEL%</label>
// <%TAGNAME% class="{$type}-body">...</%TAGNAME%>
//
// @param [$class: expand] Class name (prefix). Default: 'expand'.
@mixin toggled-display($class: expand) {
input.#{$class}-toggle {
//@include element-invisible;
display: none;
+ label {
cursor: pointer;
-webkit-tap-highlight-color: transparent;
}
}
.#{$class}-body {
display: none;
}
input.#{$class}-toggle:checked ~ .#{$class}-body {
display: block;
}
}
// toggled-flyout
//
// Define basic toggled flyout. See toggled-display.
// @param [$class: expand] Class name (prefix). Default: 'flyout'.
@mixin toggled-flyout($class: flyout) {
@include toggled-display($class);
input.#{$class}-toggle:checked ~ .#{$class}-body {
position: absolute;
z-index: 1;
}
}