Skip to content

Commit 346e27b

Browse files
committed
refactor: modernize css
1 parent 54e37e8 commit 346e27b

File tree

1 file changed

+60
-15
lines changed

1 file changed

+60
-15
lines changed

assets/css/sass/base.scss

Lines changed: 60 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,55 @@
1+
:root {
2+
--color-text: inherit;
3+
--color-accent: rgba(0, 128, 0, 0.5);
4+
--color-accent-bg: rgba(0, 128, 0, 0.15);
5+
--color-error: #f00;
6+
--color-error-bg: #fff0f0;
7+
--font-family-mono: monospace;
8+
--font-size-base: 1rem;
9+
--line-height-base: 1.5;
10+
--spacing-xs: 0.25rem;
11+
--spacing-sm: 0.5rem;
12+
--button-padding-y: 0.4em;
13+
--button-padding-x: 0.75em;
14+
--border-radius-sm: 0.25em;
15+
--transition-border: border-color 0.2s linear;
16+
--transition-shadow: box-shadow 0.2s ease-in-out;
17+
}
18+
119
#configs input {
220
width: 100%;
3-
font-family: monospace;
21+
padding: var(--spacing-xs);
22+
box-sizing: border-box;
23+
line-height: var(--line-height-base);
24+
font-size: var(--font-size-base);
25+
color: var(--color-text);
26+
font-family: var(--font-family-mono);
427
background-color: transparent;
528
border: 0;
629
border-radius: 0;
30+
outline: none;
31+
appearance: none;
32+
-webkit-font-smoothing: antialiased;
33+
-moz-osx-font-smoothing: grayscale;
734
}
835

936
.config__headline > span,
10-
.config__url.config__url {
37+
.config__url {
1138
hyphens: none;
1239
word-break: break-word;
40+
overflow-wrap: break-word;
41+
text-wrap: wrap;
1342
}
1443

1544
.config__url em {
1645
padding-right: 0.125em;
1746
letter-spacing: -0.05em;
1847
opacity: 0.75;
48+
font-style: italic;
1949
}
2050

2151
.config__url .config__url-amp:last-child {
22-
display: none;
52+
display: none !important;
2353
}
2454

2555
.js__copy-element {
@@ -29,27 +59,42 @@
2959
width: 0;
3060
height: 0;
3161
opacity: 0;
62+
pointer-events: none;
63+
user-select: text;
64+
}
3265

33-
&::selection {
34-
background-color: transparent;
35-
}
66+
.js__copy-element::selection {
67+
background-color: transparent;
3668
}
3769

3870
.noscript {
3971
font-weight: 600;
40-
color: #f00;
72+
color: var(--color-error);
73+
background: var(--color-error-bg);
74+
padding: var(--spacing-sm);
75+
border: 1px solid var(--color-error);
4176
}
4277

4378
button[data-bind-click="copy"] {
79+
padding: var(--button-padding-y) var(--button-padding-x);
4480
border: 2px solid transparent;
45-
transition: border-color 0.2s linear;
81+
border-radius: var(--border-radius-sm);
82+
background-color: #fff;
83+
color: var(--color-text);
84+
cursor: pointer;
85+
font: inherit;
86+
line-height: 1.2;
87+
transition: var(--transition-border), var(--transition-shadow);
88+
}
89+
90+
button[data-bind-click="copy"]:focus-visible {
91+
outline: 2px dashed var(--color-accent);
92+
outline-offset: 2px;
4693
}
4794

48-
button[data-bind-click="copy"].copied {
49-
&,
50-
&:hover,
51-
&:active {
52-
border-color: rgba(0, 128, 0, 0.5);
53-
box-shadow: inset 0 2px 4px rgba(0, 128, 0, 0.15);
54-
}
95+
button[data-bind-click="copy"].copied,
96+
button[data-bind-click="copy"].copied:hover,
97+
button[data-bind-click="copy"].copied:active {
98+
border-color: var(--color-accent);
99+
box-shadow: inset 0 2px 4px var(--color-accent-bg);
55100
}

0 commit comments

Comments
 (0)