Skip to content

Different between @fluentui/merge-styles and @griffel #22924

Answered by miroslavstastny
tienlx97 asked this question in Q&A
Discussion options

You must be logged in to vote

merge-styles is used in FUI v8, it will be replaced by griffel in the upcoming FUI v9.

Griffel uses atomic CSS, intentionally does not allow any props or state to be used in style computations (you only use props and state to conditionally merge and apply the resulting classes). For theming, instead of generating different styles/classes for different themes, Griffel uses CSS variables (therefore no IE11 support) for theme tokens and always produces the same styles regardless the theme.

With this approach:

  • all the styles are computed only once on the first render and never recomputed,
  • this one-time computation can be done during application build time to improve the performance,
  • the buil…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@heho
Comment options

@tienlx97
Comment options

@tienlx97
Comment options

Answer selected by tienlx97
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