|
1 | 1 | <script> |
2 | | - import { app } from '../$app'; |
3 | | - import { styleBuilder } from '../style-builder'; |
| 2 | + import { app } from '~store/store.ts'; |
| 3 | +
|
| 4 | + import { styleBuilder } from '~utils/styleBuilder'; |
4 | 5 | import { debounce } from '@github/mini-throttle'; |
5 | 6 |
|
6 | 7 | function applyTheme() { |
|
9 | 10 | currentTheme: $app.currentTheme, |
10 | 11 | currentFontFamily: $app.currentFontFamily, |
11 | 12 | currentFontSize: $app.currentFontSize, |
12 | | - accentColor: $app.currentAccentColor, |
| 13 | + currentAccentColor: $app.currentAccentColor, |
13 | 14 | scrollbars: $app.scrollbars |
14 | 15 | }); |
15 | 16 | } |
|
22 | 23 | } |
23 | 24 | </script> |
24 | 25 |
|
25 | | -<style> |
| 26 | +<style lang='scss'> |
26 | 27 | .font-setting { |
27 | 28 | display: block; |
28 | 29 | margin: 1rem auto; |
29 | | - } |
30 | 30 |
|
31 | | - .font-setting label { |
32 | | - display: block; |
33 | | - text-align: left; |
34 | | - margin-bottom: 0.5em; |
35 | | - } |
| 31 | + label { |
| 32 | + display: block; |
| 33 | + text-align: left; |
| 34 | + margin-bottom: 0.5em; |
| 35 | + } |
36 | 36 |
|
37 | | - .font-setting input { |
38 | | - display: block; |
39 | | - background-image: none; |
| 37 | + input { |
| 38 | + display: block; |
| 39 | + background-image: none; |
| 40 | + } |
| 41 | +
|
| 42 | + .accent-color-input { |
| 43 | + border: none; |
| 44 | + display: inline-block; |
| 45 | + } |
40 | 46 | } |
41 | 47 |
|
42 | 48 | .font-family input { |
|
49 | 55 | border-radius: 10px; |
50 | 56 | } |
51 | 57 |
|
52 | | - .font-setting .accent-color-input { |
53 | | - border: none; |
54 | | - display: inline-block; |
55 | | - } |
56 | | -
|
57 | 58 | .accent-reset-button { |
58 | 59 | background: var(--button); |
59 | 60 | color: var(--text); |
|
63 | 64 | border: 0; |
64 | 65 | transition: all .3s; |
65 | 66 | outline: none; |
66 | | - } |
67 | 67 |
|
68 | | - .accent-reset-button:hover { |
69 | | - background: var(--hl); |
70 | | - color: var(--selection-fg-color); |
| 68 | + &:hover { |
| 69 | + background: var(--hl); |
| 70 | + color: var(--selection-fg-color); |
| 71 | + } |
71 | 72 | } |
72 | 73 |
|
73 | 74 | .accent-color-wrapper { |
74 | 75 | display: flex; |
75 | 76 | justify-content: space-between; |
76 | 77 | } |
77 | 78 |
|
78 | | - input[type="color"] { |
| 79 | + input[type='color'] { |
79 | 80 | -webkit-appearance: none; |
80 | 81 | width: 32px; |
81 | 82 | height: 32px; |
82 | 83 | border-radius: 50%; |
83 | 84 | } |
84 | 85 |
|
85 | | - input[type="color"]::-webkit-color-swatch-wrapper { |
| 86 | + input[type='color']::-webkit-color-swatch-wrapper { |
86 | 87 | padding: 0; |
87 | 88 | border-radius: 50%; |
88 | 89 | } |
89 | 90 |
|
90 | | - input[type="color"]::-webkit-color-swatch { |
| 91 | + input[type='color']::-webkit-color-swatch { |
91 | 92 | border-color: var(--border); |
92 | 93 | border-radius: 50%; |
93 | 94 | } |
94 | 95 |
|
95 | | - input[type="checkbox"] { |
| 96 | + input[type='checkbox'] { |
96 | 97 | filter: none !important; |
97 | 98 | position: absolute !important; |
98 | 99 | opacity: 0 !important; |
99 | 100 | } |
100 | 101 |
|
101 | | - input[type="checkbox"] + label { |
| 102 | + input[type='checkbox'] + label { |
102 | 103 | position: relative !important; |
103 | 104 | cursor: pointer !important; |
104 | 105 | padding: 0 !important; |
105 | 106 | } |
106 | 107 |
|
107 | | -
|
108 | | - input[type="checkbox"] + label:before { |
| 108 | + input[type='checkbox'] + label:before { |
109 | 109 | position: relative; |
110 | 110 | content: '' !important; |
111 | 111 | margin-right: 10px !important; |
|
118 | 118 | border-radius: 4px !important; |
119 | 119 | } |
120 | 120 |
|
121 | | - input[type="checkbox"]:hover + label:before { |
| 121 | + input[type='checkbox']:hover + label:before { |
122 | 122 | background: var(--contrast) !important; |
123 | 123 | } |
124 | 124 |
|
125 | | - input[type="checkbox"]:focus + label:before { |
| 125 | + input[type='checkbox']:focus + label:before { |
126 | 126 | box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.12) !important; |
127 | 127 | } |
128 | 128 |
|
129 | | - input[type="checkbox"]:checked + label:before { |
| 129 | + input[type='checkbox']:checked + label:before { |
130 | 130 | background: var(--accent) !important; |
131 | 131 | color: var(--bg) !important; |
132 | 132 | } |
133 | 133 |
|
134 | | - input[type="checkbox"]:disabled + label { |
| 134 | + input[type='checkbox']:disabled + label { |
135 | 135 | color: #b8b8b8 !important; |
136 | 136 | cursor: auto !important; |
137 | 137 | } |
138 | 138 |
|
139 | | -
|
140 | | - input[type="checkbox"]:disabled + label:before { |
| 139 | + input[type='checkbox']:disabled + label:before { |
141 | 140 | box-shadow: none !important; |
142 | 141 | opacity: 0.6; |
143 | 142 | } |
144 | 143 |
|
145 | | - input[type="checkbox"]:checked + label:after { |
| 144 | + input[type='checkbox']:checked + label:after { |
146 | 145 | content: '' !important; |
147 | 146 | position: absolute !important; |
148 | 147 | left: 3px !important; |
|
213 | 212 | id='scrollbars' |
214 | 213 | on:change={debouncedApply} |
215 | 214 | bind:checked={$app.scrollbars} /> |
216 | | - <label for="scrollbars"></label> |
| 215 | + <label for='scrollbars'></label> |
217 | 216 | </div> |
0 commit comments