Skip to content

Commit 0389ea1

Browse files
committed
cleanup CSS: collapse/remove unused rules
Closes #1477.
1 parent f778803 commit 0389ea1

File tree

1 file changed

+50
-99
lines changed

1 file changed

+50
-99
lines changed

src/ui/options/options.css

Lines changed: 50 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -242,14 +242,18 @@ h3 + .row {
242242
margin-top: 8px;
243243
}
244244

245-
.row.customs {
245+
.row.customs,
246+
.row.site-rule {
247+
display: grid;
246248
gap: 8px;
247249
align-items: center;
248-
display: grid;
249-
grid-template-columns: 180px auto 75px auto;
250+
padding-left: 0;
251+
}
252+
253+
.row.customs {
254+
grid-template-columns: 180px auto 75px 32px;
250255
justify-content: start;
251256
margin: 10px 0;
252-
padding-left: 0;
253257
}
254258

255259
/* Special handling for rows without value inputs */
@@ -289,16 +293,8 @@ h3 + .row {
289293
display: none;
290294
}
291295

292-
/* Style disabled selects consistently */
293-
select:disabled {
294-
opacity: 0.8;
295-
background-color: var(--md-surface-variant);
296-
cursor: default;
297-
}
298-
299296
select:disabled:hover {
300297
border-color: var(--md-outline);
301-
background-color: var(--md-surface-variant);
302298
}
303299

304300
.removeParent:hover {
@@ -320,7 +316,9 @@ select:disabled:hover {
320316
box-shadow: 0 1px 2px var(--md-shadow);
321317
}
322318

323-
.removeParent:focus-visible {
319+
/* Shared focus ring */
320+
.removeParent:focus-visible,
321+
button:focus-visible {
324322
outline: 2px solid var(--md-primary);
325323
outline-offset: 2px;
326324
}
@@ -343,16 +341,39 @@ label em {
343341
font-style: normal;
344342
}
345343

346-
/* Material Design text inputs */
344+
/* Shared base styles for all form controls */
347345
input[type='text'],
348-
input[type='number'] {
349-
padding: 8px 12px;
346+
input[type='number'],
347+
textarea,
348+
select {
350349
border: 1px solid var(--md-outline);
351350
border-radius: 4px;
352351
background-color: var(--md-surface);
353352
color: var(--md-on-surface);
354353
font-size: 14px;
355354
transition: all 0.2s ease;
355+
}
356+
357+
input[type='text']:hover,
358+
input[type='number']:hover,
359+
textarea:hover,
360+
select:hover {
361+
border-color: var(--md-on-surface);
362+
}
363+
364+
input[type='text']:focus,
365+
input[type='number']:focus,
366+
textarea:focus,
367+
select:focus {
368+
outline: none;
369+
border-color: var(--md-primary);
370+
box-shadow: 0 0 0 1px var(--md-primary);
371+
}
372+
373+
/* Material Design text inputs */
374+
input[type='text'],
375+
input[type='number'] {
376+
padding: 8px 12px;
356377
min-height: 32px;
357378
width: 75px;
358379
text-align: center;
@@ -372,24 +393,13 @@ input[type='number'] {
372393
width: 60px;
373394
}
374395

375-
input[type='text']:hover,
376-
input[type='number']:hover {
377-
border-color: var(--md-on-surface);
378-
}
379-
380-
input[type='text']:focus,
381-
input[type='number']:focus {
382-
outline: none;
383-
border-color: var(--md-primary);
384-
box-shadow: 0 0 0 1px var(--md-primary);
385-
}
386-
387396
input::placeholder {
388397
opacity: 0.7;
389398
color: var(--md-on-surface-variant);
390399
}
391400

392-
input:disabled {
401+
input:disabled,
402+
select:disabled {
393403
cursor: not-allowed;
394404
opacity: 0.7;
395405
background-color: var(--md-surface-variant);
@@ -406,37 +416,16 @@ input[type='checkbox'] {
406416
textarea {
407417
width: 100%;
408418
padding: 12px;
409-
border: 1px solid var(--md-outline);
410-
border-radius: 4px;
411-
background-color: var(--md-surface);
412-
color: var(--md-on-surface);
413-
font-size: 14px;
414419
font-family: inherit;
415420
resize: vertical;
416-
transition: all 0.2s ease;
417-
}
418-
419-
textarea:hover {
420-
border-color: var(--md-on-surface);
421-
}
422-
423-
textarea:focus {
424-
outline: none;
425-
border-color: var(--md-primary);
426-
box-shadow: 0 0 0 1px var(--md-primary);
427421
}
428422

429423
/* Customizable select styling */
430424
select {
431425
appearance: none;
432426
padding: 8px 32px 8px 12px;
433-
border: 1px solid var(--md-outline);
434-
border-radius: 4px;
435-
background-color: var(--md-surface);
436-
color: var(--md-on-surface);
437427
font-size: 13px;
438428
cursor: pointer;
439-
transition: all 0.2s ease;
440429
min-height: 32px;
441430
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%2349454f' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
442431
background-repeat: no-repeat;
@@ -451,24 +440,14 @@ select {
451440
}
452441

453442
select:hover {
454-
border-color: var(--md-on-surface);
455443
background-color: var(--md-surface-variant);
456444
}
457445

458-
select:focus {
459-
outline: none;
460-
border-color: var(--md-primary);
461-
box-shadow: 0 0 0 1px var(--md-primary);
462-
}
463-
464446
/* Specific select widths */
465447
.customDo {
466448
width: 180px;
467449
}
468450

469-
@media (prefers-color-scheme: dark) {
470-
}
471-
472451
#logLevel {
473452
width: 120px;
474453
}
@@ -500,11 +479,6 @@ button:active {
500479
box-shadow: 0 1px 2px var(--md-shadow);
501480
}
502481

503-
button:focus-visible {
504-
outline: 2px solid var(--md-primary);
505-
outline-offset: 2px;
506-
}
507-
508482
/* Secondary buttons */
509483
.secondary {
510484
background-color: transparent;
@@ -520,7 +494,6 @@ button:focus-visible {
520494

521495
/* Specific button styling */
522496
#save {
523-
background-color: var(--md-primary);
524497
transition:
525498
background-color 0.25s ease,
526499
opacity 0.25s ease;
@@ -538,15 +511,6 @@ button:focus-visible {
538511
pointer-events: none;
539512
}
540513

541-
#experimental {
542-
background-color: var(--md-surface-variant);
543-
color: var(--md-on-surface);
544-
}
545-
546-
#experimental:hover {
547-
background-color: var(--md-outline-variant);
548-
}
549-
550514
#restore {
551515
background-color: transparent;
552516
color: var(--md-on-surface-variant);
@@ -567,18 +531,6 @@ button:focus-visible {
567531
}
568532
}
569533

570-
#experimental:disabled {
571-
background-color: rgba(255, 193, 7, 0.15);
572-
color: var(--md-on-surface);
573-
opacity: 1;
574-
cursor: default;
575-
}
576-
577-
#experimental:disabled:hover {
578-
background-color: rgba(255, 193, 7, 0.15);
579-
transform: none;
580-
}
581-
582534
#add {
583535
margin-top: 16px;
584536
margin-left: 0;
@@ -636,7 +588,7 @@ button:focus-visible {
636588
}
637589
}
638590

639-
/* Site rules table */
591+
/* Site rules table — header and rows share the same column template */
640592
.row:has(#site-rules-container) {
641593
flex-direction: column;
642594
gap: 8px;
@@ -646,9 +598,13 @@ button:focus-visible {
646598
flex: none;
647599
}
648600

601+
.site-rules-header,
602+
.row.site-rule {
603+
grid-template-columns: 1fr 50px 80px 32px;
604+
}
605+
649606
.site-rules-header {
650607
display: grid;
651-
grid-template-columns: 1fr 50px 80px 32px;
652608
gap: 8px;
653609
padding-left: 0;
654610
padding-bottom: 4px;
@@ -665,11 +621,6 @@ button:focus-visible {
665621
}
666622

667623
.row.site-rule {
668-
display: grid;
669-
grid-template-columns: 1fr 50px 80px 32px;
670-
gap: 8px;
671-
align-items: center;
672-
padding-left: 0;
673624
position: relative;
674625
margin: 4px 0;
675626
}
@@ -898,14 +849,14 @@ button:focus-visible {
898849
width: 100%;
899850
}
900851

901-
.site-rules-header {
852+
.site-rules-header,
853+
.row.site-rule {
902854
grid-template-columns: 1fr 50px 70px 32px;
903-
padding-left: 0;
904-
font-size: 11px;
905855
}
906856

907-
.row.site-rule {
908-
grid-template-columns: 1fr 50px 70px 32px;
857+
.site-rules-header {
858+
padding-left: 0;
859+
font-size: 11px;
909860
}
910861

911862
.row.site-rule .ruleSpeed {

0 commit comments

Comments
 (0)