@itzcull/tokens-itzcull-ui
v0.0.2
Published
UnoCSS preset for itzcull design system tokens
Maintainers
Readme
@itzcull/tokens-itzcull-ui
UnoCSS preset for the itzcull design system. Provides utility classes based on design tokens extracted from Figma.
Installation
pnpm add @itzcull/tokens-itzcull-uiUsage
Basic Setup
import { presetItzcullUI } from '@itzcull/tokens-itzcull-ui'
// uno.config.ts
import { defineConfig } from 'unocss'
export default defineConfig({
presets: [
presetItzcullUI(),
],
})Custom Configuration
import { presetItzcullUI } from '@itzcull/tokens-itzcull-ui'
// uno.config.ts
import { defineConfig } from 'unocss'
export default defineConfig({
presets: [
presetItzcullUI({
// Custom breakpoints
breakpoints: {
mobile: '480px',
tablet: '768px',
desktop: '1024px',
},
// Disable preflight reset
preflight: false,
// Custom CSS variable prefix
prefix: 'custom',
}),
],
})Available Classes
Typography
text-title-1throughtext-title-6- Title stylestext-featured-1throughtext-featured-3- Featured text stylestext-body-1throughtext-body-3- Body text stylestext-caption-1throughtext-caption-2- Caption stylesfont-regular,font-medium,font-bold- Font weights
Colors
Background Colors
bg-page,bg-page-fadedbg-primary,bg-primary-fadedbg-positive,bg-positive-fadedbg-warning,bg-warning-fadedbg-critical,bg-critical-fadedbg-neutral,bg-neutral-fadedbg-disabled,bg-disabled-faded
Text Colors
text-neutral,text-neutral-fadedtext-primarytext-positive,text-warning,text-criticaltext-disabled
Border Colors
border-neutral,border-neutral-fadedborder-primary,border-primary-fadedborder-positive,border-positive-fadedborder-warning,border-warning-fadedborder-critical,border-critical-fadedborder-disabled
Spacing
Uses a 4px base unit system:
p-x1throughp-x20- Padding (4px to 80px)m-x1throughm-x20- Margingap-x1throughgap-x20- Gap- Directional variants:
px-,py-,pt-,pr-,pb-,pl-,mx-,my-,mt-,mr-,mb-,ml-
Border Radius
rounded-small(4px)rounded-medium(8px)rounded-large(12px)rounded-circular(999px)- Directional variants:
rounded-t-,rounded-r-,rounded-b-,rounded-l-
Shadows
shadow-raised- Subtle elevationshadow-raised-reverse- Reverse subtle elevationshadow-overlay- Modal/overlay shadowshadow-overlay-reverse- Reverse overlay shadow
Responsive Design
All classes support responsive variants using your configured breakpoints:
<div class="text-body-2 md:text-featured-1 lg:text-title-6">
Responsive typography
</div>
<div class="p-x2 sm:p-x4 lg:p-x6">
Responsive padding
</div>CSS Variables
The preset automatically generates CSS variables for all design tokens. You can override these in your CSS:
:root {
--itz-color-foreground-primary: #your-custom-blue;
--itz-unit-x4: 20px; /* Custom spacing */
}Design Tokens
All design tokens are based on the Figma design system and are expressed as CSS variables for maximum flexibility and theming capabilities.
Contributing
This package is part of the @itzcull/tokens monorepo. To contribute:
- Clone the repository
- Install dependencies:
pnpm install - Make your changes
- Run tests:
pnpm typecheck && pnpm lint - Build:
pnpm build
License
MIT
