Skip to content

Layout styling on Card component #2795

Answered by TheSisb
yunuscanemre asked this question in Q&A
Discussion options

You must be logged in to vote

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!

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@SiTaggart
Comment options

@yunuscanemre
Comment options

@yunuscanemre
Comment options

@SiTaggart
Comment options

@yunuscanemre
Comment options

Answer selected by yunuscanemre
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants