How to use Emotion
Advices and “must-know” things regarding Emotion usage.
Table of contents
Usage
We won’t cover usage of Emotion in this documentation, please refer to the official documentation about how to use it.
Next Right Now supports the following ways of using Emotion:
It’s up to you to decide how you prefer to use Emotion. Next Right Now doesn’t advise or enforce any strong opinion on this matter, it’s a personal choice.
At Unly, we usually use the
cssprop. In some rare cases, we find thestyled componentapproach makes more sense. We eventually use both, but have a preference for thecssway.
SSR
SSR is already configured and compatible with Next.js, since Emotion v10. Source You don’t have anything to do.
Dependencies
@emotion/core: Necessary to use emotion, with built-incssnotation support.@emotion/styled: Necessary to use thestylednotation.emotion-theming: Theming library inspired by styled-components