Skip to content

What is the best way to style components #19127

Answered by micahgodbolt
kroudams asked this question in Q&A
Discussion options

You must be logged in to vote

In v8, mergeStyles is the preferred way to write styles. You can read all about it and see examples at https://github.com/microsoft/fluentui/blob/master/packages/merge-styles/README.md

The styles prop is the prefered method for styling components, when possible, as it allows targeting of individual parts (root, input, text etc) and those styles are mixed with the default styles, rather than trying to override them with more specific styles.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by micahgodbolt
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