Skip to content

Commit a788e54

Browse files
committed
svelte: Import global styles
1 parent f792ff9 commit a788e54

File tree

8 files changed

+740
-0
lines changed

8 files changed

+740
-0
lines changed

svelte/src/lib/css/global.css

Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
@import './shared/a11y.css';
2+
@import './shared/buttons.css';
3+
@import './shared/forms.css';
4+
@import './shared/sort-by.css';
5+
@import './shared/typography.css';
6+
7+
/*
8+
* The `normalize.css` file does not use CSS layers, so we need to vendor it
9+
* with a layer to ensure it is applied before our global styles.
10+
*/
11+
@import './normalize.css';
12+
13+
@layer global {
14+
:root {
15+
--violet800: hsl(252, 44%, 24%);
16+
--grey900: hsl(200, 15%, 19%);
17+
--grey700: hsl(200, 11%, 43%);
18+
--grey600: hsl(200, 13%, 60%);
19+
--grey200: hsl(200, 17%, 96%);
20+
--green800: hsl(115, 31%, 31%);
21+
--green900: hsl(115, 31%, 21%);
22+
23+
--orange-50: #fff7ed;
24+
--orange-100: #ffedd5;
25+
--orange-200: #fed7aa;
26+
--orange-300: #fdba74;
27+
--orange-400: #fb923c;
28+
--orange-500: #f97316;
29+
--orange-600: #ea580c;
30+
--orange-700: #c2410c;
31+
--orange-800: #9a3412;
32+
--orange-900: #7c2d12;
33+
34+
--yellow100: hsl(44, 100%, 90%);
35+
--yellow500: hsl(44, 100%, 60%);
36+
--yellow700: hsl(44, 67%, 50%);
37+
--yellow800: hsl(44, 67%, 20%);
38+
--yellow900: hsl(44, 30%, 23%);
39+
40+
--header-bg-color: light-dark(hsl(115, 31%, 20%), #141413);
41+
42+
--transition-x-slow: 1000ms;
43+
--transition-slow: 500ms;
44+
--transition-medium: 250ms;
45+
--transition-fast: 150ms;
46+
--transition-x-fast: 50ms;
47+
--transition-instant: 0ms;
48+
49+
--font-heading: 'Fira Sans', sans-serif;
50+
--font-body: var(--font-heading);
51+
--font-monospace:
52+
'Fira Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
53+
54+
--main-color: light-dark(#383838, #f9f7ec);
55+
--main-color-light: light-dark(#858585, #a6a6a6);
56+
--main-shadow-color: light-dark(var(--green900), hsl(111, 10%, 8%));
57+
--main-bg: light-dark(#f9f7ec, hsl(0, 1%, 19%));
58+
--main-bg-dark: light-dark(#edebdd, #141413);
59+
--gray-border: light-dark(#d5d3cb, #666561);
60+
--link-color: light-dark(#00ac5b, #04da75);
61+
--link-hover-color: light-dark(#007940, #00f27f);
62+
63+
--placeholder-bg: hsl(212, 7%, 57%);
64+
--placeholder-bg2: hsl(213, 16%, 75%);
65+
66+
/* see https://utopia.fyi/space/calculator?c=320,14,1.2,1140,18,1.25,5,2,&s=0.75|0.5|0.25|0.125,1.5|2|3|4|6,s-l */
67+
68+
--space-4xs: clamp(0.13rem, calc(0.13rem + 0vw), 0.13rem);
69+
--space-3xs: clamp(0.25rem, calc(0.23rem + 0.12vw), 0.31rem);
70+
--space-2xs: clamp(0.44rem, calc(0.39rem + 0.24vw), 0.56rem);
71+
--space-xs: clamp(0.69rem, calc(0.61rem + 0.37vw), 0.88rem);
72+
--space-s: clamp(0.88rem, calc(0.78rem + 0.49vw), 1.13rem);
73+
--space-m: clamp(1.31rem, calc(1.17rem + 0.73vw), 1.69rem);
74+
--space-l: clamp(1.75rem, calc(1.55rem + 0.98vw), 2.25rem);
75+
--space-xl: clamp(2.63rem, calc(2.33rem + 1.46vw), 3.38rem);
76+
--space-2xl: clamp(3.5rem, calc(3.11rem + 1.95vw), 4.5rem);
77+
--space-3xl: clamp(5.25rem, calc(4.66rem + 2.93vw), 6.75rem);
78+
79+
/* One-up pairs */
80+
--space-4xs-3xs: clamp(0.13rem, calc(0.05rem + 0.37vw), 0.31rem);
81+
--space-3xs-2xs: clamp(0.25rem, calc(0.13rem + 0.61vw), 0.56rem);
82+
--space-2xs-xs: clamp(0.44rem, calc(0.27rem + 0.85vw), 0.88rem);
83+
--space-xs-s: clamp(0.69rem, calc(0.52rem + 0.85vw), 1.13rem);
84+
--space-s-m: clamp(0.88rem, calc(0.56rem + 1.59vw), 1.69rem);
85+
--space-m-l: clamp(1.31rem, calc(0.95rem + 1.83vw), 2.25rem);
86+
--space-l-xl: clamp(1.75rem, calc(1.12rem + 3.17vw), 3.38rem);
87+
--space-xl-2xl: clamp(2.63rem, calc(1.89rem + 3.66vw), 4.5rem);
88+
--space-2xl-3xl: clamp(3.5rem, calc(2.23rem + 6.34vw), 6.75rem);
89+
90+
/* Custom pairs */
91+
--space-s-l: clamp(0.88rem, calc(0.34rem + 2.68vw), 2.25rem);
92+
93+
color-scheme: light dark;
94+
}
95+
96+
[data-color-scheme='light'] {
97+
color-scheme: light;
98+
}
99+
100+
[data-color-scheme='dark'] {
101+
color-scheme: dark;
102+
}
103+
104+
* {
105+
box-sizing: border-box;
106+
}
107+
108+
html,
109+
body {
110+
margin: 0;
111+
scroll-behavior: smooth;
112+
}
113+
114+
body {
115+
background-color: var(--header-bg-color);
116+
font-family: var(--font-body);
117+
font-size: 16px;
118+
display: flex;
119+
flex-direction: column;
120+
min-height: 100vh;
121+
}
122+
123+
h1,
124+
h2,
125+
h3,
126+
h4 {
127+
font-family: var(--font-heading);
128+
}
129+
130+
h1 {
131+
@media only screen and (max-width: 400px) {
132+
font-size: 1.5em;
133+
}
134+
}
135+
136+
a,
137+
.link,
138+
.text--link {
139+
color: var(--link-color);
140+
text-decoration: none;
141+
cursor: pointer;
142+
143+
&:hover {
144+
color: var(--link-hover-color);
145+
}
146+
}
147+
148+
/* Using `:not(...)` here for specificity reasons */
149+
a:not([href]) {
150+
color: unset;
151+
cursor: initial;
152+
}
153+
154+
pre.terminal {
155+
background: var(--main-color);
156+
color: white;
157+
padding: var(--space-s);
158+
font-family: var(--font-monospace);
159+
}
160+
161+
abbr[title] {
162+
text-decoration: none;
163+
border-bottom: 1px dotted;
164+
}
165+
166+
noscript {
167+
display: grid;
168+
justify-items: center;
169+
padding: var(--space-m);
170+
color: white;
171+
}
172+
173+
/* see https://github.com/twbs/bootstrap/pull/30269 */
174+
::-webkit-datetime-edit,
175+
::-webkit-datetime-edit-fields-wrapper,
176+
::-webkit-datetime-edit-text,
177+
::-webkit-datetime-edit-minute,
178+
::-webkit-datetime-edit-hour-field,
179+
::-webkit-datetime-edit-day-field,
180+
::-webkit-datetime-edit-month-field,
181+
::-webkit-datetime-edit-year-field {
182+
padding: 0;
183+
}
184+
185+
::-webkit-calendar-picker-indicator {
186+
font-size: 0.9em;
187+
}
188+
189+
.c-notification__icon {
190+
display: flex;
191+
justify-content: center;
192+
align-items: center;
193+
}
194+
195+
.c-notification__content {
196+
line-height: 1.5;
197+
}
198+
199+
.width-limit {
200+
width: 960px;
201+
@media only screen and (max-width: 960px) {
202+
width: 100%;
203+
}
204+
}
205+
}

0 commit comments

Comments
 (0)