/
_tabs.scss
63 lines (57 loc) · 1.32 KB
/
_tabs.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
:root {
--tab-border: 1px solid #888;
--tab-bg: var(--surface);
}
.tabs {
margin-bottom: 9px;
> input {
display: none;
~ label {
background: #eee;
border: 1px solid #ccc;
margin-left: -1px;
position: relative;
left: 1px;
line-height: unset;
&:before,
&:after {
display: none;
}
}
&:checked + label:after {
display: none;
}
}
.tab-title {
top: 1px;
position: relative; /*for #require 1*/
cursor: pointer;
float: left;
background: #ccc;
border: var(--tab-border);
border-bottom: 0;
white-space: nowrap;
}
.tab-link {
overflow: hidden;
text-align: center;
padding: 10px;
}
.tab-title:hover {
background: #eee;
}
.tab {
clear: both;
background: var(--tab-bg);
display: none;
border: var(--tab-border);
}
article {
padding: 14px;
}
input:nth-of-type(2):not(:checked) ~ input:nth-of-type(3):not(:checked) ~ .tab:nth-of-type(1),
input:nth-of-type(2):checked ~ .tab:nth-of-type(2),
input:nth-of-type(3):checked ~ .tab:nth-of-type(3) {
display: block;
}
}