-
-
Notifications
You must be signed in to change notification settings - Fork 51
Closed
Milestone
Description
Use CSS variables and/or extend Tailwind color palette to easily support dark mode, and provide more flexibility for styling customization beyond accent color and theme support (per-component classes)
Design token comparison spreadsheet
Thoughts / Questions
- What to call text/content on a color?
COLOR-content
(daisy),COLOR-foreground
(shadcn),on-COLOR
(skeleton),COLOR-text
(~open props)
- What to call main background?
base-100
(daisy),background
(shadcn)
- What to call main text color
base-content
(daisy),foreground
(shadcn),font-color-base
(skeleton),text-1
(open props)
- What color space to use (hsl, rgb, oklch)?
- rgb()
- Most universal, used by Tailwind, Skeleton
- hsl()
- Probably the most developer friendly ATM
- Used by shadcn
- oklch()
- Only supported in last 1-2 years (Safari 15.4+).
- Supports P3 colors
- Used by Daisy UI
- rgb()
- Additional properties like general borders, roundness, etc
- Should use explicit colors (most) or shades (skeleton, next-ui)
- Shades support nice pairings (skeleton) but explicit are easier to setup (and more generally used)
- Shades allow for darker shades without having to use color-mix(), which only has support this year (Safari 16.2, Chrome 111)
- Ability to reuse themes
- Should hovered filled buttons get more transparent, lighter, darker?
- Currently getting darker
- Using
color-mix()
works for any of these, but only supported in last 8-12 months? Progressive enhancement, or find way to fallback to using opacity- Tailwind
@supports
via arbitrary variant - [@supports(display:grid)]:grid
- Tailwind
- Should each component expose their own colors (like Button for
--bg-color
,--text-color
,--border-color
, etc) or is setting--ux-primary
/--ux-primary-content
sufficient- Would be a descent lift, but maybe worth it
- Some components already expose CSS variables for styling (ProgressBar as
--color
, Field/TextField). Switch current uses explicitbg-*
,border-*
but might be worth changing
- When should we use
primary
,secondary
,accent
,neutral
, etc? Always primary unless explicit?
TODO
- Determine tokens (colors, borders, etc)
- Update all components to use tokens
- Add dark mode (and maybe other themes)
- Ability to switch themes
- https://github.com/saadeghi/theme-change
- https://github.com/huntabyte/mode-watcher
- https://www.skeleton.dev/utilities/lightswitches
- https://flowbite.com/docs/customize/dark-mode/#dark-mode-switcher
- Extract Theme selector as component (to be used in other projects)
- Consider renaming current
settings: {{ theme: ... }}
toclasses
oroverrides
- Support defining theme in tailwind config
- daisy ui example
- Add examples for mappings existing themes
- Daisy UI
- Skeleton
- Basic tailwind colors
- Debate on using
bg-mix-[theme(colors.primary)/+90]
instead ofbg-primary-50
(and+80
/-100
)- Added lighter/darker shades for all theme colors (ex.
colors.primary-600
)
- Added lighter/darker shades for all theme colors (ex.
- Support changing color space (
oklch
,hsl
,rgb
) - Remove usage of old CSS variables
var(--color-blue-100)
, etc (tableBackground, etc) - Color replacement
- Replace
bg-white
withbg-surface-100
(or similar) - Replace
text-black
withtext-surface-content
(or similar) - Replace
bg-black
(andbg-black/5
,bg-black/50
, etc) possibly withbg-surface-content
- Replace
border-*
colors - Replace
*-black-*
- Replace
*-white-*
- Replace
*-gray-*
- Replace
#ddd
- All old color references (look for
-500
, etc). Example: Table'svar(--color-blue-500)
- Replace
- Globally change the default
border
color toborder-surface-300
- Rename
--ux-{COLOR}
to--color-{COLOR}
(after current--color*
variables are evaluated - Add more colors
- accent
- neutral
- Rename
error
color todanger
- Add borders (and other styles) to config
- Refine/remove default Drawer/Dialog action styles
- Update mdsvex code background (like
<Code>
/<Preview>
) - Fix tailwind prose classes (markdown pages)
- Consider setting
<input>
default background with global styles (same for scrollbars - Scrollbar styling (globally or util class) #122) - Improve handling of
system
color scheme / theme inThemeButton
- Remove
daisyui
required dependency (see LayerChart issue)- Possible become separate package
- Maybe just generate
theme.json
file that can be easily referenced
- Add default
light
/dark
themes - Update templates
- Update Customization guide
Metadata
Metadata
Assignees
Labels
No labels
Projects
Status
Done