[RFC] Refine @mui/system
scope & responsibility
#30988
siriwatknp
announced in
Early feedback
Replies: 1 comment 1 reply
-
The current stateMaterial v5Some of the nodes are not following the above-proposed structure:
If we agree on the proposed theme structure for the system (above), we can deprecate JoyIt already can start with the proposed theme structure on its own (no changes on the system) and stress test the experience to refine the final theme structure that will be a default for the System. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Soon
@mui/system
will have 2 consumers (Material & Joy), so it is worth taking a step back and refining the scope of the system package to build the right architecture.Scope & Responsibility
sx
).Theme properties
We believe that these are the foundation properties that are comprehensive to build a design system.
System forces the design system to use these properties but the scale (value of the property) can be any key-value pair.
For example:
Design system A can define the
fontSize
assmall, medium, large
Design system B can define the
fontSize
asxs, sm, md, lg
System also provides build-in properties for handling systematic space, breakpoints, zIndexs.
Typescript
Note: All the properties are empty by default which means each property is an empty object in JS.
extending the theme via module augmentation
This example extends the typography to match the need
Features
Component theming
System provides
createStyled
API to the consumer to create component that can connect to the theme:theme.components
can be used to configure & theme the specific component that renders inside theThemeProvider
:The
sx
propEvery component created by styled API accept
sx
prop by default. Thesx
value can contain shorthand notation that connects to system theme properties:The stylesheet result is transformed based on the shorthand notation.
The current state
Material v5
Some of the nodes are not following the above-proposed structure:
shadows
is an array.fontSize
, ...etc does not have a scale.shape.borderRadius
is not a scaleIf we agree on the proposed theme structure for the system (above), we can deprecate
shadows
shape
and create an adapter & a codemod to ease the migration.Joy
It already can start with the proposed theme structure on its own (no changes on the system) and stress test the experience to refine the final theme structure that will be a default for the System.
Beta Was this translation helpful? Give feedback.
All reactions