# TaishoDS Core > TaishoDS Core is a design system for plain HTML: CSS with tokens and utility classes, 56 ready-to-copy components, and the JavaScript for their behavior, with your own theme compiled into the CSS. Package `@taishods/core`, free, MIT license. Spanish version: https://taisho.design/es/llms.txt ## Rules for writing TaishoDS markup 1. Every element that uses system classes carries the `ts` class: `class="ts button size-md variant-primary"`. Without it, the element gets no styles. ```html ``` 2. Never write `ts-` in markup: `ts` is the key class, and the other classes carry no prefix (`button`, `variant-primary`, `gap-base`). 3. The vocabulary is closed: there are no arbitrary values (nothing like `p-[13px]` or `w-[37%]`). A class that isn't in the vocabulary does nothing, and `npx taisho check` flags it. 4. Spacing is written with words (`none`, `quarter`, `half`, `base`, `section`, `double`), which follow the theme's density, or with numbers, which are pixels (`p-4` is 4 px). Negative margins take `neg-` before the value (`mx-neg-base`, `mt-neg-16`). ```html
New
``` 5. Colors come only from the theme's scales: `bg-{color}-{shade}`, `color-{color}-{shade}`, `border-{color}-{shade}`. With the default theme the colors are `gray`, `brand`, `brand-secondary`, `accent`, `success`, `warning`, `info`, `danger` and the shades run from 100…1000. A custom theme can add more (`npx taisho check` shows them). There is no `dark:`: shades already switch by themselves in dark mode. ```html
Notice
``` 6. Variants (the prefix before the colon) are a closed list, and up to three can be chained, in this order: screen or container, group, state. - Screens: `sm:`, `md:`, `lg:`, `xl:`; up to a screen: `max-xl:`, `max-lg:`, `max-md:`, `max-sm:`; containers: `@sm:`, `@md:`, `@lg:`, `@xl:`, `@2xl:`, `@3xl:`, `@4xl:`, `@5xl:`, `@6xl:`, `@7xl:`; print: `print:`. - States: `hover:`, `focus:`, `focus-visible:`, `active:`, `aria-busy:`, `aria-checked:`, `aria-disabled:`, `aria-expanded:`, `aria-hidden:`, `aria-pressed:`, `aria-readonly:`, `aria-required:`, `aria-selected:`, `aria-invalid:`, `checked:`, `invalid:`, `disabled:`, `data-{name}:`. - Groups: `group-{state}:` and `peer-{state}:`, with an optional name (`group-hover/row:`) to pick which one. The reference element carries `group` or `peer`. ```html
Title
``` 7. Components are copied from their page, not invented: the markup on the page already carries the classes, the ARIA roles, and the `data-ts-*` attributes. Behavior comes from those attributes and from `taisho.core.js`; if the page says it needs no JavaScript, there is nothing to load. 8. After writing, run `npx taisho check` until it reports 0 warnings: each warning is a class or a variable the system doesn't know. 9. Icons come from Lucide: `npm i -D lucide-static` is needed only if the project uses icons (`npx taisho init` offers to install it, and `npx taisho init --install-icons` installs it without asking). If the code uses icons that don't resolve because the package is missing, `npx taisho generate` warns with the command and exits with an error; if the project uses no icons, it says nothing. ## If you know Tailwind - Numbers in size classes are pixels, not steps: `p-4` is 4 px. What is `p-4` (16 px) in Tailwind is `p-16` here, or a rhythm word (`half`, `base`) if it should follow the theme's density. - Every element carries the `ts` class. There are no arbitrary values and no `dark:`: shades switch by themselves in dark mode. - Frequent equivalents (`flex`, `grid`, `hidden`, `items-center`, `justify-between`, `w-full` and the `sm:`, `md:`, `lg:`, `xl:` prefixes are written the same): | Tailwind | TaishoDS | | --- | --- | | `p-4` | `p-16` | | `mt-2` | `mt-8` | | `gap-4` | `gap-16` | | `text-sm` | `text-14` | | `font-bold` | `weight-bold` | | `rounded-lg` | `radius-lg` | | `text-left` | `align-start` | | `text-right` | `align-end` | `npx taisho migrate --from tailwind` does the conversion: it reports what would change and, with `--write`, applies it. ## Install ### 1. Via CDN: paste three lines It's the shortest path, with nothing to install. The version is pinned in the URL: ```html ``` Order matters. The theme goes first, because it defines the variables; then the system CSS, which reads them; and the JS last, which initializes itself. Classes go on the same element as the `ts` scope class: `class="ts button size-md variant-primary"`. ### 2. With the package and CLI: your brand in the CSS To get your colors and fonts into the CSS, and only the classes you use, install the package and run the `taisho` command from your project root (Node 22.18 or later): ```bash npm i -D @taishods/core npx taisho init # asks for the language, brand, theme name, fonts, your own icons, and the output folder, and writes taisho.config.ts npx taisho generate # compiles your CSS and copies the behavior JS to that folder ``` The output folder is the one that ships with your site (for example `public/taisho`, `static/taisho`, or `./taisho`); `init` suggests one based on your project layout and saves it in `taisho.config.ts`. When it's done, `generate` prints the exact `` and ` ``` #### With a bundler (Vite and similar) If the project already uses a bundler, the CSS and the JS are imported by name from the package, with no files to copy or link: ```js import '@taishods/core/css/tokens/taisho.css'; // the system theme import '@taishods/core/css/taisho.full.css'; // the full CSS import '@taishods/core/core'; // the behavior ``` ## MCP server `npx taisho mcp` starts a local, read-only MCP server (no network, no telemetry) with tools to look up components, utilities, and the project theme, and to validate markup. Setup and examples: https://taisho.design/en/docs/ai-assistants#servidor-mcp ## Components - [Accordion](https://taisho.design/en/docs/accordion.md): A list of collapsible sections that coordinate with each other. - [AlertDialog](https://taisho.design/en/docs/alert-dialog.md): A dialog that forces a decision before moving on. - [AspectRatio](https://taisho.design/en/docs/aspect-ratio.md): Keeps a fixed aspect ratio for its content—images, video, iframes, maps—so nothing jumps while it loads. - [Avatar](https://taisho.design/en/docs/avatar.md): Represents a user or entity with an image, or with initials derived from the name as a fallback (if the image fails, Core writes them in). - [Badge](https://taisho.design/en/docs/badge.md): A compact label for statuses, categories, or counts. - [Banner](https://taisho.design/en/docs/banner.md): A full-width message for a page-wide or app-wide status. - [Breadcrumbs](https://taisho.design/en/docs/breadcrumbs.md): A hierarchical navigation trail. - [Button](https://taisho.design/en/docs/button.md): Triggers an action. - [Card](https://taisho.design/en/docs/card.md): A surface container for grouping related content. - [Checkbox](https://taisho.design/en/docs/checkbox.md): A boolean checkbox. - [Code](https://taisho.design/en/docs/code.md): A code block with a language label and a copy button. - [Collapsible](https://taisho.design/en/docs/collapsible.md): Shows or hides a block of content with a height transition. - [Combobox](https://taisho.design/en/docs/combobox.md): An editable `` with autocomplete (APG combobox pattern). - [CommandPalette](https://taisho.design/en/docs/command-palette.md): A ⌘K-style command palette with fuzzy search over grouped actions, fully keyboard-navigable. - [Container](https://taisho.design/en/docs/container.md): A page wrapper. - [ContextMenu](https://taisho.design/en/docs/context-menu.md): A menu of actions that appears when you right-click an element. - [DatePicker](https://taisho.design/en/docs/date-picker.md): Picks a date. - [Drawer](https://taisho.design/en/docs/drawer.md): A panel that slides in from an edge of the screen without fully covering what’s behind it. - [EmptyState](https://taisho.design/en/docs/empty-state.md): The block that appears when a list, table, or view has no content. - [Field](https://taisho.design/en/docs/field.md): The form primitive. - [FileUpload](https://taisho.design/en/docs/file-upload.md): A file drop zone with drag and drop. - [Grid](https://taisho.design/en/docs/grid.md): A grid with two sides: a content grid (`ts grid-container` with `grid-cols-*` and `gap-*`, which adapts to width with `sm:` and `lg:`), and a grid with divider lines between cells. - [Icon](https://taisho.design/en/docs/icon.md): An icon is an inline `` from the Lucide set. - [InlineCode](https://taisho.design/en/docs/inline-code.md): A code fragment inside a paragraph. - [Input](https://taisho.design/en/docs/input.md): A single-line text field. - [Kbd](https://taisho.design/en/docs/kbd.md): Represents a key or a keyboard combination. - [Link](https://taisho.design/en/docs/link.md): A text link with the system’s styles—an ``; an action that looks like a link is a `