@centrodphlibs/tailwind-theme
v0.0.6
Published
Tailwind CSS theme configuration based on @centrodphlibs/theme
Maintainers
Readme
@centrodphlibs/tailwind-theme
Tailwind CSS theme configuration package based on @centrodphlibs/theme. Provides Tailwind config and theme tokens for use with Tailwind CSS.
Installation
npm install @centrodphlibs/tailwind-themeUsage
Extend Tailwind Config
In your tailwind.config.js or tailwind.config.ts:
import { tailwindConfig } from '@centrodphlibs/tailwind-theme';
export default {
content: ['./src/**/*.{js,jsx,ts,tsx}'],
...tailwindConfig,
};Use Theme Tokens
import { themeTokens } from '@centrodphlibs/tailwind-theme';
console.log(themeTokens.colors.primary); // '#0b21b4'
console.log(themeTokens.spacing.m); // '4px'Theme Colors
primary: Primary brand colorsecondary: Secondary colorsuccess: Success state colorwarning: Warning state colorerror: Error state colorinfo: Info state colorbackground: Background colorsurface: Surface colortext: Primary text colortext-secondary: Secondary text colorborder: Border color
Spacing
s: Small spacing (2px)m: Medium spacing (4px)l: Large spacing (6px)
Running unit tests
Run nx test tailwind-theme to execute the unit tests via Vitest.
