CM3: Styling #1029
Replies: 3 comments 3 replies
-
Just out of curiosity, using |
Beta Was this translation helpful? Give feedback.
-
What are the benefits/downsides/tradeoffs of this approach? I trust you! Just want to learn more about why we are moving into this direction. For instance, I have rarely see cascade layers in use, so it occurs to me that it might be a little intimidating (at the same time it is so so so so simple) for folks that want to contribute, adding a little bit of friction to third-party contributions, but I don't know the advantages/disadvantages of this approach and would love to learn more |
Beta Was this translation helpful? Give feedback.
-
Shoreline styling API
Every component has its unique data-attribute for styling. It follows the pattern
data-sl-{component-name}
, wheresl
stands for Shoreline.Adding styles to the component is simple as referencing its data-attribute.
Also, you can use classNames.
For library authors, it's recommended to use the components layer.
When using csx, you can reference components inside of the
components
layer using the$
symbol:Variants
Components often have variants. They are also represented using data-attributes. The possible values for variants are
string
,number
, andboolean
. For example,To style this example. Reference the attribute on the CSS:
Usage
or (modular)
References
Beta Was this translation helpful? Give feedback.
All reactions