Archived
1
1
Fork
You've already forked website
0

Add Themes #3

Closed
opened 2023年08月15日 14:13:33 +02:00 by codingotaku · 3 comments

The web-page currently does not have dark themes, which is a problem for people reading the site in dark environments.

Consider at least using system theme with @media/prefers-color-scheme.

A theme switcher would need to save the current selected theme, this should either use JavaScript or cookies.
Use of JavaScript is avoided as much as possible on this project, we could set a session cookie or something if someone needs to set the theme manually.

Ideally, the cookie should not be set/sent when using the default theme (set using prefers-color-scheme)

The web-page currently does not have dark themes, which is a problem for people reading the site in dark environments. Consider at least using system theme with [@media/prefers-color-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme). A theme switcher would need to save the current selected theme, this should either use JavaScript or cookies. Use of JavaScript is avoided as much as possible on this project, we could set a session cookie or something if someone needs to set the theme manually. Ideally, the cookie should not be set/sent when using the default theme (set using `prefers-color-scheme`)
Author
Owner
Copy link

Dark theme is now supported, but uses system preference for the theme. i.e, there is no theme switch option yet.

Dark mode

Dark Mode

Light mode

Light Mode

Dark theme is now supported, but uses system preference for the theme. i.e, there is no theme switch option yet. ## Dark mode ![Dark Mode](/attachments/f5d8ecef-2aaf-4efc-9d43-e742de46ef29) ## Light mode ![Light Mode](/attachments/5b2325fa-adc9-4b62-92bd-fd5bb4bfef7d)
460 KiB
452 KiB
Author
Owner
Copy link

After giving it some more thought, I decided not to go with using cookies to store the theme preference, using JavaScript to do it is out of options as I'm stubborn.

If someone requests, and is okay with using cookies, I might reconsider this and re-open this issue.

After giving it some more thought, I decided not to go with using cookies to store the theme preference, using JavaScript to do it is out of options as I'm stubborn. If someone requests, and is okay with using cookies, I might reconsider this and re-open this issue.
Author
Owner
Copy link

I'm eating my words here, the themes are now saved using cookies (if changed) and the cookies will be removed when the system theme is selected.

I have also added some text below the theme switcher to indicate that we now use cookies.
Screenshot of codingotaku.com/settings page.

Yes, we also have a pink theme now!

I'm eating my words here, the themes are now saved using cookies (if changed) and the [cookies will be removed](https://codeberg.org/codingotaku/website/src/commit/06bc2cabd2ce4b98395013cf91145acdf246c7bb/src/routes/main_pages.rs#L151) when the system theme is selected. I have also added some text below the theme switcher to indicate that we now use cookies. ![Screenshot of codingotaku.com/settings page.](/attachments/8ae150ad-f2d9-438e-8dd9-c974a1dcb973) Yes, we also have a pink theme now!
134 KiB
Commenting is not possible because the repository is archived.
main
main
indie-auth-improvements
databse-migration
No results found.
Labels
Clear labels
Kind/Breaking
Breaking change that won't be backward compatible
Kind/Bug
Something is not working
Kind/Documentation
Documentation changes
Kind/Enhancement
Improve existing functionality
Kind/Feature
New functionality
Kind/Security
This is security issue
Kind/Testing
Issue or pull request related to testing
Priority
Critical
The priority is critical
Priority
High
The priority is high
Priority
Low
The priority is low
Priority
Medium
The priority is medium
Reviewed
Confirmed
Issue has been confirmed
Reviewed
Duplicate
This issue or pull request already exists
Reviewed
Invalid
Invalid issue
Reviewed
Won't Fix
This issue won't be fixed
Status
Abandoned
Somebody has started to work on this but abandoned work
Status
Blocked
Something is blocking this issue or pull request
Status
Need More Info
Feedback is required to reproduce issue or to continue work
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
codingotaku/website#3
Reference in a new issue
codingotaku/website
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?