@carbonium-ion/tailwind-config
v0.0.14
Published
This package contains a basic tailwind configuration, overriding some tailwind tokens, according with Carbonium Ion Tokens.
Downloads
94
Keywords
Readme
Carbonium Ion - Tailwind Config
This package contains a basic tailwind configuration, overriding some tailwind tokens, according with Carbonium Ion Tokens.
Installation
From npm
npm install @carbonium-ui/tailwind-config
Basic usage
Using the configuration as a preset in a tailwind.config.ts
file from another application:
import type { Config } from 'tailwindcss'
import sharedConfig from "@carbonium-ui/tailwind-config"
const config: Pick<Config, "presets" | "content"> = {
content: ["./src/**/*.tsx"],
presets: [sharedConfig],
};
export default config
Using a specific color token inside a .tsx
file:
import colors from '@carbonium-ui/tailwind-config/colors'
interface ButtonProps {
isPrimaryButton: boolean
}
export function Button({ isPrimaryButton }: ButtonProps) {
const buttonBackgroundColor = isPrimaryButton ? colors.sky[500] : colors.gray.[500]
return (
<button style={{ backgroundColor: buttonBackgroundColor }}>
Label
</button>
)
}