Using the next theme
We're currently in the process of rolling out a new visual design for our products, driven by the design system. This guide describes how to enable the new visual design in both new and existing projects This guide describes how to enable the new visual design in both new and existing projects.
React
The new visual design is applied entirely via theme context and can be applied
either at the BlueprintProvider
or with a nested NextProvider
.
Global Application
New projects should follow the instructions for
getting started, with one small change. When setting up the
BlueprintProvider
,
pass 'all'
to the next
prop.
This can also be applied to existing projects, ideally controlling the value of
next
with a feature flag.
Local Application
The new visual design can also be applied to a single component or subtree by
using NextProvider
.
Attaching CSS Variables
Because theming is powered by CSS variables, we need to attach the overridden
CSS variables to an HTML element. If the immediate child of NextProvider
renders and HTML element, you can simply set attach
and the provider will set
the appropriate id
attribute on that element in order for it to recieve the
variable definitions.
If you need to attach the variables to an element further down in the tree,
you'll need to use the useNextThemeRootClassName
hook at set the className
attribute.