You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The general idea is that there is a curated set of custom properties that can be set to define the look and feel of the components.
All custom properties are unset per default and there are no default values defined inside component styles. But there is a default-custom-properties.css file containing all variables with a default configuration.
The default-custom-properties.css file can be imported and overridden by taking advantage of the CSS order of appearance rule. It could also be copied and modified but in this case it should be advised to always check for new variables/defaults when upgrading the library.
Naming
The naming of the variables is a act of balance between readability and keeping the names short.
All variables should have a library suffix, like --sys42- to help avoid global namespace issues.
The general pattern is PREFIX-NAME-PROPERTY--STATE
Using the variables
All variables can be used by any component. For example a SpecialButton can use --sys42-button-border-radius to be in sync the the radius of buttons.
It is not wanted that everything can be configured, there should be unstyled versions of all components that can be used to change a design more drastically if needed.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The general idea is that there is a curated set of custom properties that can be set to define the look and feel of the components.
All custom properties are unset per default and there are no default values defined inside component styles. But there is a
default-custom-properties.cssfile containing all variables with a default configuration.The
default-custom-properties.cssfile can be imported and overridden by taking advantage of the CSS order of appearance rule. It could also be copied and modified but in this case it should be advised to always check for new variables/defaults when upgrading the library.Naming
The naming of the variables is a act of balance between readability and keeping the names short.
All variables should have a library suffix, like
--sys42-to help avoid global namespace issues.Without abbreviations names are quite long:
--sys42-button-padding-horizontal--sys42-button-border-radiusMy first idea was to use Emmet syntax and abbreviations like:
--sys42-button-p-h--sys42-button-bdrsBut this syntax is hard to read and not everyone might know that
bdrsis short forborder-radius.My current approach is to write it out like, but use some abbreviations. The rules for this are yet to be defined:
--sys42-button-padding-horiz--sys42-button-padding-vert--sys42-button-background--sys42-button-background--hoverThe general pattern is
PREFIX-NAME-PROPERTY--STATEUsing the variables
All variables can be used by any component. For example a
SpecialButtoncan use--sys42-button-border-radiusto be in sync the the radius of buttons.It is not wanted that everything can be configured, there should be unstyled versions of all components that can be used to change a design more drastically if needed.
Beta Was this translation helpful? Give feedback.
All reactions