Styling Patterns #2598
mannycarrera4
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
How do we style and use our styling utilities
As we build and design components, it's worth keeping track of certain patterns to optimize the style transform and to keep consistency across our components. This discussion is intended as a guidance for how we implement styles.
createStencilStencil. Example:const menuCardStencil = createStencil({}).MenuCardbeing the component you're applying the stencil to.mergeStyleswhen calling your stencil.<Element {...mergeStyles(elemProps, myComponentStencil())}/>Tokens
0based value, usesystem.shape.zeroforborder-radiusandsystem.space.zerofor other px based values (except non px values, such as opacity, z-index).px2rempx2remhelper function if value is not represented by token<Element/><Element/>in the return function. This prevents us from using components that might compose style and behavior. Not all use cases might be this simple.cssis what consumers expect.Beta Was this translation helpful? Give feedback.
All reactions