Created
January 30, 2023 21:50
-
-
Save jaruesink/b55533c1953500fbe84e76da24fbc2f2 to your computer and use it in GitHub Desktop.
Example Tailwind Config using CSS Vars for color theme
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { createGlobPatternsForDependencies } = require('@nrwl/react/tailwind'); | |
const colors = require('tailwindcss/colors'); | |
const defaultTheme = require('tailwindcss/defaultTheme'); | |
/** @type {import('tailwindcss').Config} */ | |
module.exports = { | |
content: ['./app/**/*.{ts,tsx,jsx,js}', ...createGlobPatternsForDependencies(__dirname)], | |
theme: { | |
extend: { | |
fontFamily: { | |
display: ['var(--font-display)'], | |
body: ['var(--font-body)'], | |
sans: ['var(--font-body)'] | |
}, | |
colors: { | |
primary: { | |
DEFAULT: 'rgb(var(--color-primary-DEFAULT) / <alpha-value>)', | |
50: 'rgb(var(--color-primary-50) / <alpha-value>)', | |
100: 'rgb(var(--color-primary-100) / <alpha-value>)', | |
200: 'rgb(var(--color-primary-200) / <alpha-value>)', | |
300: 'rgb(var(--color-primary-300) / <alpha-value>)', | |
400: 'rgb(var(--color-primary-400) / <alpha-value>)', | |
500: 'rgb(var(--color-primary-500) / <alpha-value>)', | |
600: 'rgb(var(--color-primary-600) / <alpha-value>)', | |
700: 'rgb(var(--color-primary-700) / <alpha-value>)', | |
800: 'rgb(var(--color-primary-800) / <alpha-value>)', | |
900: 'rgb(var(--color-primary-900) / <alpha-value>)' | |
}, | |
accent: { | |
DEFAULT: 'rgb(var(--color-accent-DEFAULT) / <alpha-value>)', | |
50: 'rgb(var(--color-accent-50) / <alpha-value>)', | |
100: 'rgb(var(--color-accent-100) / <alpha-value>)', | |
200: 'rgb(var(--color-accent-200) / <alpha-value>)', | |
300: 'rgb(var(--color-accent-300) / <alpha-value>)', | |
400: 'rgb(var(--color-accent-400) / <alpha-value>)', | |
500: 'rgb(var(--color-accent-500) / <alpha-value>)', | |
600: 'rgb(var(--color-accent-600) / <alpha-value>)', | |
700: 'rgb(var(--color-accent-700) / <alpha-value>)', | |
800: 'rgb(var(--color-accent-800) / <alpha-value>)', | |
900: 'rgb(var(--color-accent-900) / <alpha-value>)' | |
}, | |
highlight: { | |
DEFAULT: 'rgb(var(--color-highlight-DEFAULT) / <alpha-value>)', | |
50: 'rgb(var(--color-highlight-50) / <alpha-value>)', | |
100: 'rgb(var(--color-highlight-100) / <alpha-value>)', | |
200: 'rgb(var(--color-highlight-200) / <alpha-value>)', | |
300: 'rgb(var(--color-highlight-300) / <alpha-value>)', | |
400: 'rgb(var(--color-highlight-400) / <alpha-value>)', | |
500: 'rgb(var(--color-highlight-500) / <alpha-value>)', | |
600: 'rgb(var(--color-highlight-600) / <alpha-value>)', | |
700: 'rgb(var(--color-highlight-700) / <alpha-value>)', | |
800: 'rgb(var(--color-highlight-800) / <alpha-value>)', | |
900: 'rgb(var(--color-highlight-900) / <alpha-value>)' | |
} | |
}, | |
screens: { | |
xs: '400px' | |
}, | |
fontSize: { | |
'2xs': '.65rem', | |
'2xl': ['1.5rem', { lineHeight: '1.5rem' }] | |
} | |
} | |
}, | |
plugins: [ | |
require('@tailwindcss/typography'), | |
require('@tailwindcss/line-clamp'), | |
require('@tailwindcss/forms'), | |
require('@tailwindcss/aspect-ratio') | |
] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment