Skip to content

Navigation Menu

Sign in
Sign up

Catalyst Theming #1985

jonmears started this conversation in General
Discussion options

What approach are people taking when theming their Catalyst site? Is there any documentation on extending or creating your own Vibes or independent theme?

You must be logged in to vote

Replies: 1 comment

Comment options

Our approach was to override the tailwind config and load custom theme for a multi site theme setup.

Sample tailwind config. We drove our config via env SITE.


const themeConfig = require('./tailwind-theme.config');
const selectedThemeConfig = themeConfig[process.env.SITE] || themeConfig.default; // Fallback to a default config
const config = {
 content: ['./src/**/*.{ts,tsx}', './app/**/*.{ts,tsx}', './components/**/*.{ts,tsx}'],
 theme: selectedThemeConfig,
 plugins: [require('tailwindcss-radix')(), require('tailwindcss-animate')],
};
module.exports = config;

Now for tailwind-theme.config

we did something like the following

const shared = {
 black: 'var(--black)',
 white: {
 DEFAULT: 'var(--white)',
 powder: 'var(--white-powder)',
 smoke: 'var(--white-smoke)',
 },
 red: 'var(--red)',
}
const themeConfig = {
 SITE_A: {
 colors: {
 primary: 'var(--brand-red)',
 secondary: 'var(--brand-orange)',
 'btn-primary': 'var(--brand-blue)',
 'btn-secondary': 'var(--white)',
 ...shared,
 },
 },
 SITE_B: {
 colors: {
 primary: 'var(--brand-yellow)',
 secondary: 'var(--brand-green)',
 ...shared,
 },
 
 },
 default: {
 colors: {
 primary: 'var(--brand-primary)',
 secondary: 'var(--brand-secondary)',
 ...shared,
 },
 },
};
module.exports = themeConfig;

Good luck

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /