[RFC] How should theme be extended
@gndz07 is already working on this.
Since Jan 18, 2022.
- Dominant language
- TypeScript
- Stars
- 41
- Forks
- 16
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 3
Description
Goals
- Allow easy extension of our theme configuration
- Allow following our pattern with specific theming per component
Background
Currently, we export our theme configuration and our custom color themes (dark/light)

We also export createTheme to allow other projects creating their own theme or completely overriding the ones we produced.
❎ We do not export a simple way to extend our already defined dark and light themes.
From stitches doc, I see no way to extend themes.
They only show how to extend the default theme returned by createStitches with createTheme.
Proposals
- Should we create custom local themes when we need per component extensions ?
import customThemeConfig from './CustomElement.themes.ts';
const CustomElement: () => JSX.Element = ...;
const customElementTheme = createTheme(..., {
...customThemeConfig, // somehow we add the custom theme config
});
const CustomElementWithTheme = () => {
return (
<div className={customElementTheme}>
<CustomElement />
</div>
);
}
export default CustomElementWithTheme
I fear we might lose dark/light themes for the specific component's context to gain our custom config.
NB: I don't really like this option so far.
- Maybe we could expose a way to extend dark and light themes easily?
export const extendTheme: (existingTheme: 'dark' | 'light') => ReturnType<typeof createTheme>
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.