Skip to content

what is the difference between 4 options of applying styles #2284

Discussion options

You must be logged in to vote

is there a recommended method

As often with software development, it depends™️

Option 1:

I use this when other users are consuming a site I built with Theme UI and they should be able to easily style the UI without going into the React component itself. This is even more important if the UI is shipped as a npm package and they can't actually change the React components.

Option 2 & Option 3:

With the given example I'd think this is just preference for syntax. I often create my own Box component that only accepts certain props and then only the ones from the theme, then I prefer the syntax from Option 2 as it looks cleaner to me.

Option 3:

Important to note: You can apply this to any elem…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by lachlanjc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants