-
Notifications
You must be signed in to change notification settings - Fork 0
The scalability of the settings in the theme #8
Comments
There is a common background for element states. Links, buttons (perhaps form inputs, and who knows what else) share the same state: export type TLinkStatePresetNames =
| "default"
| "active"
| "visited"
| "disabled"
| "hidden"; Finding a mechanism to style these states would solve the scalability issue. |
Also |
A proof of concept is done: https://github.com/osequi/test-presets All theme entries except scale, colors can be refactored to a common base: |
|
At this moment there is a way back, if something will go wrong: https://github.com/osequi/somenage/tree/v0.1.0-refactoring |
https://github.com/osequi/test-presets now features tokens vs. presets and supports fonts, colors, and links. Ready to refactor Somenage. |
The main idea behind theming is to enforce rules thus keep things uniform.
An example:
A link can be freely styled through
settings
when those settings are not present in the theme. When a setting is present in the theme (colors
) it should be moved out from settings. This would like to enforce the usage of the same colors across the design system.For example
textDecorationColor: "red"
will break the color system.This strictness might not scale well.
For example, what if we want bold links? Setting
fontWeight: 'bold'
ondeafult
would again break the font system. Instead we should use the 'Nimbus Sans Bold' font through a hook. That would result in adding a new sectionfonts
to the already existingcolors
andsettings
. And this might not scale freely.Perhaps an error-prone, totally uniform design system doesn't scales so well.
The text was updated successfully, but these errors were encountered: