-
Notifications
You must be signed in to change notification settings - Fork 1
/
css.css
111 lines (91 loc) · 1.48 KB
/
css.css
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
/*
CSS for the main interaction
*/
.accordion > input[type="checkbox"] {
position: absolute;
left: -100vw;
}
.accordion .content {
overflow-y: hidden;
height: 0;
transition: height 0.3s ease;
}
.accordion > input[type="checkbox"]:checked ~ .content {
height: auto;
overflow: visible;
}
.accordion label {
display: block;
}
/*
Styling
*/
body {
font: 16px/1.5em "Overpass", "Open Sans", Helvetica, sans-serif;
color: #333;
font-weight: 300;
}
.accordion {
margin-bottom: 1em;
}
.accordion > input[type="checkbox"]:checked ~ .content {
padding: 15px;
border: 1px solid #e8e8e8;
border-top: 0;
}
.accordion .handle {
margin: 0;
font-size: 1.125em;
line-height: 1.2em;
}
.accordion label {
color: #333;
cursor: pointer;
font-weight: normal;
padding: 15px;
background: #e8e8e8;
}
.accordion label:hover,
.accordion label:focus {
background: #d8d8d8;
}
.accordion .handle label:before {
font-family: 'fontawesome';
content: "\f054";
display: inline-block;
margin-right: 10px;
font-size: .58em;
line-height: 1.556em;
vertical-align: middle;
}
.accordion > input[type="checkbox"]:checked ~ .handle label:before {
content: "\f078";
}
/*
Demo purposes only
*/
*,
*:before,
*:after {
box-sizing: border-box;
}
body {
padding: 40px;
}
a {
color: #06c;
}
p {
margin: 0 0 1em;
}
h1 {
margin: 0 0 1.5em;
font-weight: 600;
font-size: 1.5em;
}
.accordion {
max-width: 65em;
}
.accordion p:last-child {
margin-bottom: 0;
}