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
css
prop. In some rare cases, we find thestyled component
approach makes more sense. We eventually use both, but have a preference for thecss
way.
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-incss
notation support.@emotion/styled
: Necessary to use thestyled
notation.emotion-theming
: Theming library inspired by styled-components