Skip to content

Commit 5ac21d6

Browse files
feat: expand clickable area for setting items (#1194)
1 parent ca99e79 commit 5ac21d6

File tree

3 files changed

+31
-24
lines changed

3 files changed

+31
-24
lines changed

src/css/browserAction.css

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,28 @@
44
--window-padding: 1.75rem;
55
--container-outside-text-padding-left: 0.25rem;
66

7-
--theme-background-color: #f2f3f6;
8-
--theme-secondary-background-color: white;
9-
--theme-secondary-background-color-variant: #fafafc;
10-
--theme-font-color: rgb(51, 51, 51);
11-
--theme-secondary-font-color: rgb(51, 51, 51, 0.7);
7+
--md-surface-container: #f2f3f6;
8+
--md-surface: white;
9+
--md-surface-variant: #fafafc;
10+
--md-on-surface: rgb(51, 51, 51);
11+
--md-on-surface-variant: rgb(51, 51, 51, 0.7);
1212

1313
--md-sys-color-primary: rgb(73, 113, 214);
14-
--md-sys-color-on-primary: var(--theme-secondary-background-color);
14+
--md-sys-color-on-primary: var(--md-surface);
1515
--md-sys-color-on-surface-variant: #888;
1616
--md-sys-color-on-surface: #aaa;
1717
}
1818

1919
@media (prefers-color-scheme: dark) {
2020
:root {
21-
--theme-background-color: #0d0e14;
22-
--theme-secondary-background-color: #1f2029;
23-
--theme-secondary-background-color-variant: #2a2b37;
24-
--theme-font-color: #ebedf2;
25-
--theme-secondary-font-color: #a8b2c7;
21+
--md-surface-container: #0d0e14;
22+
--md-surface: #1f2029;
23+
--md-surface-variant: #2a2b37;
24+
--md-on-surface: #ebedf2;
25+
--md-on-surface-variant: #a8b2c7;
2626

2727
--md-sys-color-primary: rgb(98, 125, 194);
28-
--md-sys-color-on-primary: var(--theme-secondary-background-color);
28+
--md-sys-color-on-primary: var(--md-surface);
2929
--md-sys-color-on-surface-variant: #aaa;
3030
--md-sys-color-on-surface: #888;
3131
}
@@ -41,8 +41,8 @@
4141
body {
4242
padding: var(--window-padding);
4343
width: max-content;
44-
background: var(--theme-background-color);
45-
color: var(--theme-font-color);
44+
background: var(--md-surface-container);
45+
color: var(--md-on-surface);
4646
font-size: 1rem;
4747
}
4848

@@ -61,7 +61,7 @@ h1 {
6161
margin-left: 0.5rem;
6262
color: inherit;
6363
text-decoration: none;
64-
color: var(--theme-secondary-font-color);
64+
color: var(--md-on-surface-variant);
6565
}
6666

6767
fieldset {
@@ -92,7 +92,7 @@ settings-description {
9292

9393
small {
9494
font-size: 0.8em;
95-
color: var(--theme-secondary-font-color);
95+
color: var(--md-on-surface-variant);
9696
padding-left: var(--container-outside-text-padding-left);
9797
}
9898

src/ts/components/settingsDescription.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class SettingsDescription extends LitElement {
1717
font-size: 0.8rem;
1818
flex-grow: 1;
1919
width: 0;
20-
color: var(--theme-secondary-font-color);
20+
color: var(--md-on-surface-variant);
2121
}
2222
`;
2323

src/ts/components/settingsItem.ts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,35 @@ class SettingsItem extends LitElement {
2020
flex-direction: row;
2121
justify-content: space-between;
2222
align-items: center;
23-
gap: 1rem;
24-
background: var(--theme-secondary-background-color);
25-
padding: 1rem 1.5rem;
23+
background: var(--md-surface);
2624
border-radius: 0.25rem;
2725
transition: background 0.2s;
2826
}
2927
3028
.settings-item:hover {
31-
background: var(--theme-secondary-background-color-variant);
29+
background: var(--md-surface-variant);
3230
}
3331
34-
.settings-item,
3532
.settings-item > * {
3633
cursor: pointer;
34+
padding: 1rem 0;
3735
}
3836
39-
.settings-item > label {
37+
.settings-item > *:first-child {
38+
padding-left: 1.5rem;
39+
}
40+
41+
.settings-item > *:last-child {
42+
padding-right: 1.5rem;
43+
}
44+
45+
label {
4046
flex-grow: 1;
4147
}
4248
43-
md-checkbox {
49+
.settings-item > md-checkbox {
4450
flex-shrink: 0;
51+
padding-left: 1.5rem;
4552
}
4653
4754
.first-item {

0 commit comments

Comments
 (0)