mirror of
https://github.com/hiaaryan/sileo.git
synced 2026-04-26 23:45:50 +03:00
[PR #24] [MERGED] feat: add dark/light/system theme support #26
Labels
No labels
bug
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/sileo#26
Loading…
Add table
Add a link
Reference in a new issue
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?
📋 Pull Request Information
Original PR: https://github.com/hiaaryan/sileo/pull/24
Author: @lubauss
Created: 2/21/2026
Status: ✅ Merged
Merged: 2/22/2026
Merged by: @hiaaryan
Base:
main← Head:feat/theme-support📝 Commits (1)
1bd0076feat: add dark/light/system theme support📊 Changes
2 files changed (+44 additions, -2 deletions)
View changed files
📝
src/styles.css(+10 -0)📝
src/toast.tsx(+34 -2)📄 Description
Summary
Add a
themeprop to<Toaster>that automatically sets the toast fill color and description text color based on the active theme. Supports'light','dark', and'system'(auto-detects viaprefers-color-scheme).Problem
Sileo defaults to a white fill (
#FFFFFF), making toasts invisible or unreadable in dark mode apps. There's no built-in way to adapt to the user's color scheme.Solution
New
themeprop onSileoToasterPropslight#FFFFFFrgba(0, 0, 0, 0.7)dark#1a1a1argba(255, 255, 255, 0.8)systemprefers-color-schemeImplementation details
useResolvedThemehook — listens tomatchMedia('(prefers-color-scheme: dark)')changes whentheme='system'THEME_FILLSmap — maps resolved theme to fill color, applied as default instore.optionsdata-themeattribute — set on[data-sileo-viewport]for CSS-based theme targeting[data-theme="dark"]/[data-theme="light"]for description text colorFiles Changed
src/toast.tsxthemeprop,useResolvedThemehook,THEME_FILLS,data-themeattrsrc/styles.css[data-theme]CSS rules for description text colorBackward Compatibility
themeprop is optional — omitting it preserves existing behavior (white fill, nodata-themeattr)filloverrides on toast calls still take precedenceTesting
theme="system"and toggle OS dark/light mode — fill and text color should switch automaticallytheme="dark"— verify description text is readable (light text on dark background)themeprop — verify behavior is unchanged from current releaseCloses #20
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.