-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.css
151 lines (128 loc) · 2.95 KB
/
index.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
@import './theme.css';
body {
background-color: var(--background-color);
color: var(--text-color);
display: flex;
font-family: var(--font-face);
justify-content: center;
margin: 2em;
}
#main {
background-color: var(--main-background-color);
background-image: radial-gradient(
closest-corner circle,
var(--main-background-color) 70%,
var(--main-background-color-vignette) 100%
);
border-radius: 1em;
box-shadow: 0.5ex 0.5ex 1em var(--main-shadow-color);
padding: 1em;
}
#main > h1 {
color: var(--accent-color);
display: flex;
font-size: calc(var(--font-size) * 2);
justify-content: center;
margin: 0 0 1ex;
text-shadow: 1px 1px var(--accent-shadow-lower), -1px -1px var(--accent-shadow-upper);
}
#main > section {
margin: 0.5ex 0;
}
#complete-all, #new-task {
font-size: var(--font-size);
}
#complete-all {
-webkit-appearance: none;
appearance: none;
font-family: var(--font-face);
}
#complete-all::before {
content: var(--unchecked);
}
#complete-all:checked::before {
content: var(--checked);
}
#new-task {
background-color: var(--background-color);
border: 2px solid var(--border-color);
border-radius: 0.5ex;
color: var(--text-color);
padding: 0.5ex;
width: var(--task-width);
}
#new-task:focus-visible {
outline: var(--accent-color) solid 2px;
}
#add-task {
border: none;
background-color: transparent;
font-size: calc(var(--font-size) * 0.75);
padding: 0;
}
#add-task::before {
content: var(--add-icon);
}
/*
Counters are implemented here, in CSS only.
The DOM already knows how many tasks are complete.
You don't need to track that state elsewhere.
*/
#task-list {
counter-reset: tasks;
}
task-item:not(.complete) {
counter-increment: tasks;
}
#counter::before {
content: counter(tasks) ' ';
}
/*
Hide filtered tasks and the radio buttons.
Again, only CSS is necessary because the DOM knows the state of the contents it owns.
*/
input[name='filter'],
#main[data-filter='active'] task-item.complete,
#main[data-filter='complete'] task-item:not(.complete) {
display: none;
}
/* Style the filter labels to look more like selectable buttons. */
input[name='filter'] + label {
border: 2px solid transparent;
border-radius: 0.5ex;
padding: 0.5ex 0.5em;
}
input[name='filter']:checked + label {
background-color: var(--background-color);
border-color: var(--accent-color);
}
/* Miscellaneous styling fixes. */
footer {
align-items: center;
display: flex;
font-size: var(--footer-font-size);
justify-content: center;
margin-top: 1em;
}
footer > :is(span, fieldset, div) {
flex: 1;
}
footer > div {
display: flex;
justify-content: flex-end;
}
#filter {
display: flex;
border: unset;
justify-content: center;
padding-block: unset;
}
#clear-completed {
appearance: none;
background-color: var(--background-color);
border: 2px solid var(--accent-color);
border-radius: 0.5ex;
color: var(--text-color);
font-size: var(--footer-font-size);
padding: 0.5ex 0.5em;
}