### Install @tokenami/ds Package Source: https://github.com/dspindola/tokenami/blob/main/packages/ds/README.md Installs the @tokenami/ds package using npm. This is the initial step to integrate the design system into your project. ```sh npm install @tokenami/ds ``` -------------------------------- ### Install Tokenami CLI and CSS Utility Source: https://github.com/dspindola/tokenami/blob/main/README.md Installs the Tokenami command-line interface and the core CSS utility package as development dependencies using npm. ```sh npm install -D tokenami && npm install @tokenami/css ``` -------------------------------- ### Run Development Server - Bash Commands Source: https://github.com/dspindola/tokenami/blob/main/examples/nextjs/README.md Commands to start the development server for a Next.js project using different package managers (npm, yarn, pnpm, bun). These commands initiate the local development environment for building and testing the application. ```bash npm run dev # or yarn dev # or pnpm dev # or bun dev ``` -------------------------------- ### Run Tokenami Watcher for CSS Generation Source: https://github.com/dspindola/tokenami/blob/main/README.md Starts the Tokenami CLI in watch mode to continuously build CSS files. It specifies an output file and watches for changes, recompiling as needed. ```sh npx tokenami --output ./public/styles.css --watch ``` -------------------------------- ### Set Up CSS Utility with Aliases Source: https://github.com/dspindola/tokenami/blob/main/README.md Configures a CSS utility function by importing `createCss` and a configuration object. This setup is essential for resolving conflicts when using custom property aliases across components. The `config` object is passed to `createCss` to initialize the utility. ```typescript // css.ts import { createCss } from '@tokenami/css'; import config from '../.tokenami/tokenami.config'; export const css = createCss(config); ``` -------------------------------- ### Style Composition with Includes in Tokenami CSS Source: https://context7.com/dspindola/tokenami/llms.txt Shows how to compose styles using the `includes` option for better code reuse. This example uses `css` and `css.compose` from '@tokenami/css' to create reusable style blocks for buttons. ```tsx import { css, type TokenamiCSS } from '@tokenami/css'; // Reusable focus styles (inline) const focusable = css({ '--focus_outline': 'var(--outline_sm)', '--focus_outline-offset': 2, '--focus_outline-color': 'var(--color_primary)', }); // Base button (composed, extracted to stylesheet) const baseButton = css.compose({ '--display': 'inline-flex', '--align-items': 'center', '--justify-content': 'center', '--padding': 4, '--border-radius': 'var(--radii_rounded)', '--font-weight': 500, '--transition': 'all 0.2s ease', }); // Specialized button inheriting base styles const primaryButton = css.compose({ includes: [baseButton, focusable], '--background': 'var(--color_primary)', '--color': 'var(--color_white)', '--hover_background': 'var(--color_primary-dark)', }); function PrimaryButton(props) { const [cn, styles] = primaryButton(); return // Output: