From a87b95ed186d8de7a0c9f7226696f4425d8cb5ac Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Tue, 17 Jan 2023 17:58:04 +0800 Subject: [PATCH] Restyle settings sheet --- src/pages/settings.css | 25 ++- src/pages/settings.jsx | 392 +++++++++++++++++++++-------------------- 2 files changed, 228 insertions(+), 189 deletions(-) diff --git a/src/pages/settings.css b/src/pages/settings.css index 6805b463..0f786504 100644 --- a/src/pages/settings.css +++ b/src/pages/settings.css @@ -1,12 +1,28 @@ +#settings-container { + background-color: var(--bg-faded-color); +} + #settings-container h2 { - font-size: 0.9em; + font-size: 85%; text-transform: uppercase; color: var(--text-insignificant-color); + font-weight: normal; } #settings-container h2 ~ h2 { margin-top: 2em; } +#settings-container :is(section, .section) { + background-color: var(--bg-color); + margin: 0 -16px; + padding: 8px 16px; + border-top: var(--hairline-width) solid var(--outline-color); + border-bottom: var(--hairline-width) solid var(--outline-color); +} +#settings-container :is(section, .section) > li + li { + border-top: var(--hairline-width) solid var(--outline-color); +} + #settings-container ul { margin: 0; padding: 0; @@ -82,3 +98,10 @@ #settings-container .radio-group label:has(input:checked) input:checked + span { color: inherit; } + +@media (min-width: 40em) { + #settings-container :is(section, .section) { + margin-inline: 0; + border-radius: 8px; + } +} diff --git a/src/pages/settings.jsx b/src/pages/settings.jsx index 92da8d2e..60b55d38 100644 --- a/src/pages/settings.jsx +++ b/src/pages/settings.jsx @@ -33,218 +33,234 @@ function Settings({ onClose }) { */}

Accounts

- - {moreThanOneAccount && ( -

- - Note: Default account will always be used for first load. - Switched accounts will persist during the session. - + + ); + })} + + {moreThanOneAccount && ( +

+ + Note: Default account will always be used for first load. + Switched accounts will persist during the session. + +

+ )} +

+ + Add new account +

- )} -

- - Add new account - -

-

Theme

-
{ - console.log(e); - e.preventDefault(); - const formData = new FormData(themeFormRef.current); - const theme = formData.get('theme'); - const html = document.documentElement; - - if (theme === 'auto') { - html.classList.remove('is-light', 'is-dark'); - } else { - html.classList.toggle('is-light', theme === 'light'); - html.classList.toggle('is-dark', theme === 'dark'); - } - document - .querySelector('meta[name="color-scheme"]') - .setAttribute('content', theme); - - if (theme === 'auto') { - store.local.del('theme'); - } else { - store.local.set('theme', theme); - } - }} - > -
- - - -
-
+

Settings

- +

Hidden features

-

- -

+
+
+ +
+

About

-

- - Built - {' '} - by{' '} - { - e.preventDefault(); - states.showAccount = 'cheeaun@mastodon.social'; - }} - > - @cheeaun - - . -

- {__BUILD_TIME__ && ( +

- Last build: {' '} - {__COMMIT_HASH__ && ( - <> - ( - - {__COMMIT_HASH__} - - ) - - )} + + Built + {' '} + by{' '} + { + e.preventDefault(); + states.showAccount = 'cheeaun@mastodon.social'; + }} + > + @cheeaun + + .

- )} + {__BUILD_TIME__ && ( +

+ Last build: {' '} + {__COMMIT_HASH__ && ( + <> + ( + + {__COMMIT_HASH__} + + ) + + )} +

+ )} +
);