Skip to content

Commit dc399f2

Browse files
committed
[refactor] move css variables to stand alone file
1 parent e8dafed commit dc399f2

File tree

3 files changed

+174
-174
lines changed

3 files changed

+174
-174
lines changed

‎src/css/base.css‎

Lines changed: 0 additions & 174 deletions
Original file line numberDiff line numberDiff line change
@@ -1,129 +1,3 @@
1-
:root{
2-
--root-font-size:14px;
3-
--black:0,0,0;
4-
--white:255,255,255;
5-
--shade-01:38,40,49;
6-
--shade-02:47,51,62;
7-
--shade-03:57,62,75;
8-
--shade-04:67,73,88;
9-
--shade-05:77,84,101;
10-
--shade-06:87,95,114;
11-
--shade-07:97,106,127;
12-
--shade-08:107,117,140;
13-
--shade-09:117,128,153;
14-
--shade-10:127,139,166;
15-
--shade-11:137,151,180;
16-
--shade-12:149,162,187;
17-
--shade-13:162,173,195;
18-
--shade-14:174,184,203;
19-
--shade-15:187,195,211;
20-
--shade-16:199,206,218;
21-
--shade-17:212,217,226;
22-
--shade-18:224,228,234;
23-
--shade-19:237,239,242;
24-
--shade-20:250,250,250;
25-
--button-text:var(--gray-12);
26-
--button-text-hover-focus:var(--style-neutral-text);
27-
--button-text-active:var(--style-neutral-text);
28-
--button-text-disabled:var(--gray-04);
29-
--button-link-text:var(--gray-12);
30-
--button-link-text-hover-focus:var(--style-neutral-text);
31-
--button-link-text-active:var(--style-neutral-text);
32-
--button-link-text-disabled:var(--gray-04);
33-
--form-input-text:var(--gray-16);
34-
--form-input-border:2;
35-
--form-input-text-hover:var(--style-neutral-text);
36-
--form-input-text-focus:var(--style-neutral-text);
37-
--form-input-text-disabled:var(--gray-02);
38-
--form-input-text-disabled-helper-text:var(--gray-04);
39-
--form-input-placeholder:var(--gray-06);
40-
--form-input-placeholder-hover-focus:var(--gray-10);
41-
--form-input-placeholder-disabled:var(--gray-04);
42-
--form-label:var(--gray-12);
43-
--form-label-disabled:var(--gray-04);
44-
--form-checkbox-radio-label:var(--gray-12);
45-
--form-checkbox-radio-chcked-label:var(--gray-16);
46-
--form-checkbox-radio-disabled-label:var(--gray-04);
47-
--form-range-thumb:var(--gray-12);
48-
--theme-accent:250,130,0;
49-
--theme-radius:0.2rem;
50-
--line-width:0.2em;
51-
--background:rgb(var(--gray-01));
52-
--gutter:0.5rem;
53-
--font-regular:"Open Sans Regular", sans-serif;
54-
--font-bold:"Open Sans Bold", sans-serif;
55-
--font-light:"Open Sans Light", sans-serif;
56-
--font-fjalla:"Fjalla One Regular", sans-serif;
57-
--header-area-width:100%;
58-
--header-shade-color: transparent;
59-
--header-shade-opacity:0.95;
60-
--header-search-width:0%;
61-
--header-border-top:0;
62-
--header-border-bottom:0;
63-
--header-date-size:1em;
64-
--header-clock-size:1em;
65-
--header-search-size:1em;
66-
--header-button-size:1em;
67-
--header-greeting-size:1em;
68-
--header-transitional-size:1em;
69-
--link-area-width:100%;
70-
--link-area-gutter-multiplier:2;
71-
--link-item-size:1em;
72-
--link-item-display-letter-size:2em;
73-
--link-item-display-icon-size:2.5em;
74-
--link-item-name-size:0.9em;
75-
--background-image: none;
76-
--background-opacity:1;
77-
--background-scale:1;
78-
--background-accent-opacity:0;
79-
--background-blur:0;
80-
--layout-width:80%;
81-
--layout-padding-multiplier:4;
82-
--layout-gutter-multiplier:4;
83-
--animation-speed-fast:0.2s;
84-
--animation-speed-medium:0.4s;
85-
--animation-speed-slow:0.6s;
86-
--shadow-small:01px2pxrgba(0,0,0,0.1),02px4pxrgba(0,0,0,0.2);
87-
--shadow-medium:02px4pxrgba(0,0,0,0.1),04px8pxrgba(0,0,0,0.2);
88-
--shadow-large:03px6pxrgba(0,0,0,0.1),06px12pxrgba(0,0,0,0.2);
89-
--z-index-background:1000;
90-
--z-index-link:2000;
91-
--z-index-header:3000;
92-
--z-index-tip:4000;
93-
--z-index-shade:5000;
94-
--z-index-modal:6000;
95-
--z-index-menu:7000;
96-
--z-index-auto-suggest-list:8000;
97-
--z-index-edge:9000;
98-
/* breakpoint reference */
99-
/* can not be used in @media as of yet */
100-
--breakpoint-sm:550px;
101-
--breakpoint-md:700px;
102-
--breakpoint-lg:900px;
103-
--breakpoint-xl:1100px;
104-
--breakpoint-xxl:1600px;
105-
}
106-
107-
:root.is-link-style-block{
108-
--link-item-width:11em;
109-
--link-item-height:10em;
110-
--link-item-url-height:20%;
111-
--link-item-edit-height:30%;
112-
}
113-
114-
:root.is-link-style-list{
115-
--link-item-width:20em;
116-
--link-item-height:4em;
117-
--link-item-url-height:30%;
118-
--link-item-edit-height:50%;
119-
}
120-
121-
@media (min-width:700px){
122-
:root{
123-
--root-font-size:16px;
124-
}
125-
}
126-
1271
::selection{
1282
background-color:rgb(var(--theme-accent));
1293
color:rgb(var(--white));
@@ -174,51 +48,3 @@ body{
17448
.is-layout-alignment-vertical-bottombody{
17549
justify-content: flex-end;
17650
}
177-
178-
.is-theme-style-dark{
179-
--gray-01:var(--shade-01);
180-
--gray-02:var(--shade-02);
181-
--gray-03:var(--shade-03);
182-
--gray-04:var(--shade-04);
183-
--gray-05:var(--shade-05);
184-
--gray-06:var(--shade-06);
185-
--gray-07:var(--shade-07);
186-
--gray-08:var(--shade-08);
187-
--gray-09:var(--shade-09);
188-
--gray-10:var(--shade-10);
189-
--gray-11:var(--shade-11);
190-
--gray-12:var(--shade-12);
191-
--gray-13:var(--shade-13);
192-
--gray-14:var(--shade-14);
193-
--gray-15:var(--shade-15);
194-
--gray-16:var(--shade-16);
195-
--gray-17:var(--shade-17);
196-
--gray-18:var(--shade-18);
197-
--gray-19:var(--shade-19);
198-
--gray-20:var(--shade-20);
199-
--style-neutral-text:var(--white);
200-
}
201-
202-
.is-theme-style-light{
203-
--gray-01:var(--shade-20);
204-
--gray-02:var(--shade-19);
205-
--gray-03:var(--shade-18);
206-
--gray-04:var(--shade-17);
207-
--gray-05:var(--shade-16);
208-
--gray-06:var(--shade-15);
209-
--gray-07:var(--shade-14);
210-
--gray-08:var(--shade-13);
211-
--gray-09:var(--shade-12);
212-
--gray-10:var(--shade-11);
213-
--gray-11:var(--shade-10);
214-
--gray-12:var(--shade-09);
215-
--gray-13:var(--shade-08);
216-
--gray-14:var(--shade-07);
217-
--gray-15:var(--shade-06);
218-
--gray-16:var(--shade-05);
219-
--gray-17:var(--shade-04);
220-
--gray-18:var(--shade-03);
221-
--gray-19:var(--shade-02);
222-
--gray-20:var(--shade-01);
223-
--style-neutral-text:var(--black);
224-
}

‎src/css/variables.css‎

Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
:root{
2+
--root-font-size:14px;
3+
--black:0,0,0;
4+
--white:255,255,255;
5+
--shade-01:38,40,49;
6+
--shade-02:47,51,62;
7+
--shade-03:57,62,75;
8+
--shade-04:67,73,88;
9+
--shade-05:77,84,101;
10+
--shade-06:87,95,114;
11+
--shade-07:97,106,127;
12+
--shade-08:107,117,140;
13+
--shade-09:117,128,153;
14+
--shade-10:127,139,166;
15+
--shade-11:137,151,180;
16+
--shade-12:149,162,187;
17+
--shade-13:162,173,195;
18+
--shade-14:174,184,203;
19+
--shade-15:187,195,211;
20+
--shade-16:199,206,218;
21+
--shade-17:212,217,226;
22+
--shade-18:224,228,234;
23+
--shade-19:237,239,242;
24+
--shade-20:250,250,250;
25+
--button-text:var(--gray-12);
26+
--button-text-hover-focus:var(--style-neutral-text);
27+
--button-text-active:var(--style-neutral-text);
28+
--button-text-disabled:var(--gray-04);
29+
--button-link-text:var(--gray-12);
30+
--button-link-text-hover-focus:var(--style-neutral-text);
31+
--button-link-text-active:var(--style-neutral-text);
32+
--button-link-text-disabled:var(--gray-04);
33+
--form-input-text:var(--gray-16);
34+
--form-input-border:2;
35+
--form-input-text-hover:var(--style-neutral-text);
36+
--form-input-text-focus:var(--style-neutral-text);
37+
--form-input-text-disabled:var(--gray-02);
38+
--form-input-text-disabled-helper-text:var(--gray-04);
39+
--form-input-placeholder:var(--gray-06);
40+
--form-input-placeholder-hover-focus:var(--gray-10);
41+
--form-input-placeholder-disabled:var(--gray-04);
42+
--form-label:var(--gray-12);
43+
--form-label-disabled:var(--gray-04);
44+
--form-checkbox-radio-label:var(--gray-12);
45+
--form-checkbox-radio-chcked-label:var(--gray-16);
46+
--form-checkbox-radio-disabled-label:var(--gray-04);
47+
--form-range-thumb:var(--gray-12);
48+
--theme-accent:250,130,0;
49+
--theme-radius:0.2rem;
50+
--line-width:0.2em;
51+
--background:rgb(var(--gray-01));
52+
--gutter:0.5rem;
53+
--font-regular:"Open Sans Regular", sans-serif;
54+
--font-bold:"Open Sans Bold", sans-serif;
55+
--font-light:"Open Sans Light", sans-serif;
56+
--font-fjalla:"Fjalla One Regular", sans-serif;
57+
--header-area-width:100%;
58+
--header-shade-color: transparent;
59+
--header-shade-opacity:0.95;
60+
--header-search-width:0%;
61+
--header-border-top:0;
62+
--header-border-bottom:0;
63+
--header-date-size:1em;
64+
--header-clock-size:1em;
65+
--header-search-size:1em;
66+
--header-button-size:1em;
67+
--header-greeting-size:1em;
68+
--header-transitional-size:1em;
69+
--link-area-width:100%;
70+
--link-area-gutter-multiplier:2;
71+
--link-item-size:1em;
72+
--link-item-display-letter-size:2em;
73+
--link-item-display-icon-size:2.5em;
74+
--link-item-name-size:0.9em;
75+
--background-image: none;
76+
--background-opacity:1;
77+
--background-scale:1;
78+
--background-accent-opacity:0;
79+
--background-blur:0;
80+
--layout-width:80%;
81+
--layout-padding-multiplier:4;
82+
--layout-gutter-multiplier:4;
83+
--animation-speed-fast:0.2s;
84+
--animation-speed-medium:0.4s;
85+
--animation-speed-slow:0.6s;
86+
--shadow-small:01px2pxrgba(0,0,0,0.1),02px4pxrgba(0,0,0,0.2);
87+
--shadow-medium:02px4pxrgba(0,0,0,0.1),04px8pxrgba(0,0,0,0.2);
88+
--shadow-large:03px6pxrgba(0,0,0,0.1),06px12pxrgba(0,0,0,0.2);
89+
--z-index-background:1000;
90+
--z-index-link:2000;
91+
--z-index-header:3000;
92+
--z-index-tip:4000;
93+
--z-index-shade:5000;
94+
--z-index-modal:6000;
95+
--z-index-menu:7000;
96+
--z-index-auto-suggest-list:8000;
97+
--z-index-edge:9000;
98+
/* breakpoint reference */
99+
/* can not be used in @media as of yet */
100+
--breakpoint-sm:550px;
101+
--breakpoint-md:700px;
102+
--breakpoint-lg:900px;
103+
--breakpoint-xl:1100px;
104+
--breakpoint-xxl:1600px;
105+
}
106+
107+
.is-theme-style-dark{
108+
--gray-01:var(--shade-01);
109+
--gray-02:var(--shade-02);
110+
--gray-03:var(--shade-03);
111+
--gray-04:var(--shade-04);
112+
--gray-05:var(--shade-05);
113+
--gray-06:var(--shade-06);
114+
--gray-07:var(--shade-07);
115+
--gray-08:var(--shade-08);
116+
--gray-09:var(--shade-09);
117+
--gray-10:var(--shade-10);
118+
--gray-11:var(--shade-11);
119+
--gray-12:var(--shade-12);
120+
--gray-13:var(--shade-13);
121+
--gray-14:var(--shade-14);
122+
--gray-15:var(--shade-15);
123+
--gray-16:var(--shade-16);
124+
--gray-17:var(--shade-17);
125+
--gray-18:var(--shade-18);
126+
--gray-19:var(--shade-19);
127+
--gray-20:var(--shade-20);
128+
--style-neutral-text:var(--white);
129+
}
130+
131+
.is-theme-style-light{
132+
--gray-01:var(--shade-20);
133+
--gray-02:var(--shade-19);
134+
--gray-03:var(--shade-18);
135+
--gray-04:var(--shade-17);
136+
--gray-05:var(--shade-16);
137+
--gray-06:var(--shade-15);
138+
--gray-07:var(--shade-14);
139+
--gray-08:var(--shade-13);
140+
--gray-09:var(--shade-12);
141+
--gray-10:var(--shade-11);
142+
--gray-11:var(--shade-10);
143+
--gray-12:var(--shade-09);
144+
--gray-13:var(--shade-08);
145+
--gray-14:var(--shade-07);
146+
--gray-15:var(--shade-06);
147+
--gray-16:var(--shade-05);
148+
--gray-17:var(--shade-04);
149+
--gray-18:var(--shade-03);
150+
--gray-19:var(--shade-02);
151+
--gray-20:var(--shade-01);
152+
--style-neutral-text:var(--black);
153+
}
154+
155+
.is-link-style-block{
156+
--link-item-width:11em;
157+
--link-item-height:10em;
158+
--link-item-url-height:20%;
159+
--link-item-edit-height:30%;
160+
}
161+
162+
.is-link-style-list{
163+
--link-item-width:20em;
164+
--link-item-height:4em;
165+
--link-item-url-height:30%;
166+
--link-item-edit-height:50%;
167+
}
168+
169+
@media (min-width:700px){
170+
:root{
171+
--root-font-size:16px;
172+
}
173+
}

‎src/index.html‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<metaname="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
88
<title>New Tab</title>
99
<linkrel="stylesheet" href="css/reset.css">
10+
<linkrel="stylesheet" href="css/variables.css">
1011
<linkrel="stylesheet" href="css/base.css">
1112
<linkrel="stylesheet" href="css/main.css">
1213
<linkrel="stylesheet" href="css/edge.css">

0 commit comments

Comments
(0)