The variable will be automatically switched across the DOM when switching theme via `CunninghamProvider`.
## Customizing themes
As you have see in the previous sections you can customize the design tokens by editing `cunningham.ts`, you may have noticed
that in all the examples you had to wrap the modifications inside the following fields:
<Source dark={true} code={`
// cunningham.ts
import { DefaultTokens } from "@openfun/cunningham-react";
const config: DefaultTokens = {
themes: {
default: {
...
},
},
};
export default config;
`}></Source>
In reality in this case you are editing the theme called `default` ( which refer to the light theme ), if you want to edit
the dark theme you have to provide the `dark` key accordingly
<Source dark={true} code={`
// cunningham.ts
import { DefaultTokens } from "@openfun/cunningham-react";
const config: DefaultTokens = {
themes: {
default: {
...
},
dark: {
...
},
},
};
export default config;
`}></Source>
## Creating your theme
The logic is the same as what we saw previously. Just add a new key inside the `themes` object.
> ⚠️ All themes extends the `default` theme by default, that's why it is named `default` and not `light`. A consequence is that you don't have to provide all existing design tokens when creating a new theme, you can just customize the one you want.
<Source dark={true} code={`
// cunningham.ts
import { DefaultTokens } from "@openfun/cunningham-react";