Layout styling on Card component #2795
-
hi folks, is there a good way to set styles on the Card component to alter its default layout behaviour. I'm trying to create a card like this where the content isn't naturally wide enough to create this width. But if I try to set styles like |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Hi @yunuscanemre, In Paste, we don't style with inline CSS or stylesheets. Instead, we use a CSS-in-JS approach where we apply styles as props to components directly. There are several advantages: we can typecheck and provide guardrails to styles on our components, which in turn allows us to evolve the designs over time without any breaking changes. The base component you can apply any style to is called Box. Here's a codesandbox demo that shows how you can compose a Box with a Card to set a Hope this helps! |
Beta Was this translation helpful? Give feedback.
Hi @yunuscanemre,
In Paste, we don't style with inline CSS or stylesheets. Instead, we use a CSS-in-JS approach where we apply styles as props to components directly. There are several advantages: we can typecheck and provide guardrails to styles on our components, which in turn allows us to evolve the designs over time without any breaking changes.
The base component you can apply any style to is called Box. Here's a codesandbox demo that shows how you can compose a Box with a Card to set a
maxWidth
.Hope this helps!