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
-
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.
createStencil
Stencil
. Example:const menuCardStencil = createStencil({})
.MenuCard
being the component you're applying the stencil to.mergeStyles
when calling your stencil.<Element {...mergeStyles(elemProps, myComponentStencil())}/>
Tokens
0
based value, usesystem.shape.zero
forborder-radius
andsystem.space.zero
for other px based values (except non px values, such as opacity, z-index).px2rem
px2rem
helper 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.css
is what consumers expect.Beta Was this translation helpful? Give feedback.
All reactions