|
11 | 11 | --color-output-normal-background: #ddd; |
12 | 12 | --color-output-error-text: #800; |
13 | 13 | --color-output-error-background: #fcc; |
| 14 | + --color-run-button-background: #eee; |
| 15 | + --color-run-button-boarder: #ccc; |
| 16 | + --color-run-button-text: #222; |
| 17 | + --color-run-button-hover-background: #666; |
| 18 | + --color-run-button-hover-boarder: #ccc; |
| 19 | + --color-run-button-hover-text: #fff; |
| 20 | + --color-buttons-background: #eee; |
| 21 | + --color-buttons-boarder: #ccc; |
| 22 | + --color-buttons-text: #222; |
| 23 | + --color-buttons-hover-background: #666; |
| 24 | + --color-buttons-hover-boarder: #ccc; |
| 25 | + --color-buttons-hover-text: #fff; |
| 26 | + --color-share-url-background: #eee; |
| 27 | + --color-share-url-boarder: #ccc; |
| 28 | + --color-share-url-text: black; |
14 | 29 |
|
15 | 30 | --font-family-banner-title: Arial, sans; |
16 | 31 | --font-size-banner-title: 32px; |
17 | 32 | --font-size-banner-title-sub: 24px; |
18 | | - |
19 | | - /* "mono" applies to mono-space text boxes, i.e. code, line number, and output */ |
| 33 | + --font-family-controls: sans-serif; |
| 34 | + --font-size-controls: 16px; |
| 35 | + --size-format-imports-toggle: 30px; |
20 | 36 | --font-family-mono: Menlo, Courier\ New, monospace; |
21 | 37 | --font-size-mono: 11pt; |
22 | 38 | --padding-mono: 5px; |
23 | 39 | --tab-size-code-text: 4; |
24 | 40 | } |
25 | 41 |
|
| 42 | +[data-theme='dark'] { |
| 43 | + --color-banner-title-text: white; |
| 44 | + --color-banner-background: black; |
| 45 | + /* TODO(grantnelson-wf): Finish */ |
| 46 | +} |
| 47 | + |
| 48 | + |
26 | 49 | html, body { |
27 | 50 | width: 100%; |
28 | 51 | height: 100%; |
@@ -71,72 +94,124 @@ html, body { |
71 | 94 | margin-left: auto; |
72 | 95 | } |
73 | 96 |
|
74 | | -/* The run code button */ |
75 | | -#run-button { /* TODO(grantnelson-wf): Update */ |
76 | | - background: #eee; |
77 | | - border: 1px solid #ccc; |
78 | | - color: #222; |
79 | | - font-size: 20px; |
80 | | - height: 30px; |
| 97 | +#controls input[type=button] { |
| 98 | + padding: 5px 8px 5px 8px; |
81 | 99 | border-radius: 5px; |
| 100 | + margin-left: 10px; /* TODO(grantnelson-wf): Try replacing with gap */ |
| 101 | + font-family: var(--font-family-controls); |
| 102 | + font-size: var(--font-size-controls); |
| 103 | +} |
| 104 | + |
| 105 | +/* The run code button */ |
| 106 | +#run-button { |
| 107 | + background: var(--color-run-button-background); |
| 108 | + border: 1px solid var(--color-run-button-boarder); |
| 109 | + color: var(--color-run-button-text); |
82 | 110 | } |
83 | 111 |
|
84 | | -#run-button:hover { /* TODO(grantnelson-wf): Update */ |
85 | | - background: #666; |
86 | | - color: #fff; |
| 112 | +#run-button:hover { |
| 113 | + background: var(--color-run-button-hover-background); |
| 114 | + border-color: var(--color-run-button-hover-boarder); |
| 115 | + color: var(--color-run-button-hover-text); |
87 | 116 | } |
88 | 117 |
|
89 | 118 | /* The format code button */ |
90 | | -#format-button { /* TODO(grantnelson-wf): Update */ |
91 | | - background: #eee; |
92 | | - border: 1px solid #ccc; |
93 | | - color: #222; |
94 | | - font-size: 20px; |
95 | | - height: 30px; |
96 | | - border-radius: 5px; |
| 119 | +#format-button { |
| 120 | + background: var(--color-buttons-background); |
| 121 | + border: 1px solid var(--color-buttons-boarder); |
| 122 | + color: var(--color-buttons-text); |
97 | 123 | } |
98 | 124 |
|
99 | | -#format-button:hover { /* TODO(grantnelson-wf): Update */ |
100 | | - background: #666; |
101 | | - color: #fff; |
| 125 | +#format-button:hover { |
| 126 | + background: var(--color-buttons-hover-background); |
| 127 | + border-color: var(--color-buttons-hover-boarder); |
| 128 | + color: var(--color-buttons-hover-text); |
102 | 129 | } |
103 | 130 |
|
104 | 131 | /* The checkbox and label for indicating if imports should be formatted */ |
105 | | -#format-imports-label { /* TODO(grantnelson-wf): Update */ |
106 | | - font-family: sans-serif; |
107 | | - font-size: 16px; |
| 132 | +#format-imports-control { |
| 133 | + font-family: var(--font-family-controls); |
| 134 | + font-size: var(--font-size-controls); |
| 135 | + display: flex; |
| 136 | + align-items: center; |
| 137 | + gap: 2px; |
| 138 | +} |
| 139 | + |
| 140 | +#format-imports-checkbox { |
| 141 | + display: none; |
| 142 | + box-sizing: border-box; |
108 | 143 | } |
109 | 144 |
|
110 | | -/* The checkbox for indicating if imports should be formatted */ |
111 | | -#format-imports { /* TODO(grantnelson-wf): Update */ |
112 | | - height: 14px; |
| 145 | +#format-imports-checkbox+#format-imports-toggle { |
| 146 | + outline: 0; |
| 147 | + display: block; |
| 148 | + box-sizing: border-box; |
| 149 | + width: calc(var(--size-format-imports-toggle)/2); |
| 150 | + height: var(--size-format-imports-toggle); |
| 151 | + position: relative; |
| 152 | + cursor: pointer; |
| 153 | + -webkit-user-select: none; |
| 154 | + -moz-user-select: none; |
| 155 | + -ms-user-select: none; |
| 156 | + user-select: none; |
| 157 | + background: #f0f0f0; |
| 158 | + border-radius: calc(var(--size-format-imports-toggle)/2); |
| 159 | + border: 1 solid #222; |
| 160 | + padding: 2px; |
| 161 | + transition: all 0.4s ease; |
| 162 | +} |
| 163 | + |
| 164 | +#format-imports-checkbox+#format-imports-toggle:after { |
| 165 | + position: relative; |
| 166 | + top: 50%; |
| 167 | + display: block; |
| 168 | + content: ""; |
| 169 | + width: 100%; |
| 170 | + height: 50%; |
| 171 | + border-radius: 50%; |
| 172 | + background: #ccc; |
| 173 | + transition: all 0.2s ease; |
| 174 | +} |
| 175 | + |
| 176 | +#format-imports-checkbox:checked+#format-imports-toggle { |
| 177 | + background: green; |
113 | 178 | } |
114 | 179 |
|
| 180 | +#format-imports-checkbox:checked+#format-imports-toggle:after { |
| 181 | + top: 0; |
| 182 | +} |
| 183 | + |
| 184 | + |
| 185 | + |
| 186 | + |
| 187 | + |
115 | 188 | /* The share code button */ |
116 | | -#share-button { /* TODO(grantnelson-wf): Update */ |
117 | | - background: #eee; |
118 | | - border: 1px solid #ccc; |
119 | | - color: #222; |
120 | | - font-size: 20px; |
121 | | - height: 30px; |
122 | | - border-radius: 5px; |
| 189 | +#share-button { |
| 190 | + background: var(--color-buttons-background); |
| 191 | + border: 1px solid var(--color-buttons-boarder); |
| 192 | + color: var(--color-buttons-text); |
123 | 193 | } |
124 | 194 |
|
125 | | -#share-button:hover { /* TODO(grantnelson-wf): Update */ |
126 | | - background: #666; |
127 | | - color: #fff; |
| 195 | +#share-button:hover { |
| 196 | + background: var(--color-buttons-hover-background); |
| 197 | + border-color: var(--color-buttons-hover-boarder); |
| 198 | + color: var(--color-buttons-hover-text); |
128 | 199 | } |
129 | 200 |
|
130 | 201 | /* The text box containing the url for sharing code. */ |
131 | | -#share-url { /* TODO(grantnelson-wf): Update */ |
132 | | - width: 320px; |
133 | | - font-size: 16px; |
134 | | - border: 1px solid #ccc; |
135 | | - background: #eee; |
| 202 | +#share-url { |
| 203 | + margin-left: 5px; |
| 204 | + flex-grow: 3; |
| 205 | + font-family: var(--font-family-controls); |
| 206 | + font-size: var(--font-size-controls); |
| 207 | + border: 1px solid var(--color-share-url-boarder); |
| 208 | + background: var(--color-share-url-background); |
| 209 | + color: var(--color-share-url-text); |
136 | 210 | } |
137 | 211 |
|
138 | 212 | .share-url-hidden { |
139 | | - display: none; |
| 213 | + /*display: none;*/ |
| 214 | + background-color: orange; /* TODO(grantnelson-wf): Undo */ |
140 | 215 | } |
141 | 216 |
|
142 | 217 | /* The panel that contains everything below the banner */ |
@@ -196,6 +271,9 @@ html, body { |
196 | 271 | /* The readonly line numbers next to the code */ |
197 | 272 | #line-nums { |
198 | 273 | text-align: right; |
| 274 | + -webkit-user-select: none; |
| 275 | + -moz-user-select: none; |
| 276 | + -ms-user-select: none; |
199 | 277 | user-select: none; |
200 | 278 | overflow: hidden; |
201 | 279 | text-overflow: clip; |
|
0 commit comments