Skip to content

All articles

Introducing TaishoDS Core: a design system in plain HTML, CSS and JavaScript

56 components, a whole theme from one brand color, and a command that checks your markup. MIT-licensed, 0.17.5 on npm.

Pablo Di Filippo

Type one hex color and TaishoDS Core gives back the whole theme: ten steps for light mode, ten for dark, and text on every step that passes AA.

Enlarge image:
The theme editor on the home page: a brand color is typed in, then round corners, serif headings and warm neutrals are picked, and the color is changed. The sample screen repaints on every change.
The theme editor on the home page. Every choice repaints the sample screen, and the HTML stays the same.

TaishoDS Core is a design system written in plain HTML, CSS and JavaScript, with no framework underneath. It has 56 components, a utility vocabulary and that theme engine. It's MIT-licensed, it installs from npm or loads from a CDN in three lines, and 0.17.5 is out on npm.

I started it because I needed one system for my own products and for client work, and I couldn't find one that enforced quality by itself instead of asking it of the people using it. So I set one rule: quality has to be enforced by the system, not by discipline. If the engine can compute something, or a test can catch it, it shouldn't depend on someone remembering to do it.

Here's what's in it:

At the end there's what isn't tested yet.

Change the brand without touching the HTML

A theme starts from one hex color. From it the engine builds a ten-step scale, 100 to 1000, for light mode and another for dark mode, and gives every step the color of the text that goes on top. With the package installed, the theme can also be applied in the browser, without a build step:

ts

The editor on the home page shows that code for whatever theme you put together. This is the scale #3b82f6 produces:

Enlarge image:
The ten-step scale of #3b82f6 in light and dark mode, with the contrast of the text on each step
The scale of #3b82f6. Each number is the contrast of the text on its step; in light mode, 500 and 600 come out nearly equal because one carries dark text and the other light.

Each step has a target contrast against the page background. The engine searches for the lightness that gives it, and then keeps light or dark text, whichever has more contrast on top.

According to the 2026 WebAIM Million, low-contrast text is the most commonly detected failure across the top million home pages: it shows up on 83.9% of them, and it has topped the list in every edition since 2019.

I ran it on 4,096 starting colors, every three-digit hex from #000 to #fff, in light and dark mode with the default grays. WCAG's AA level asks for a contrast ratio of 4.5 for normal text. Across the 81,920 steps that came out, the text of a step on that same step never dropped below 4.5, either as computed or measured in the 8 bits per channel a screen paints. The lowest was 4.50, and that's not luck: it's a brand color the engine left exactly as it was because it just made it.

Enlarge image:
Histogram of the contrast of the text on its step across the 81,920 steps of the sweep, with the AA line at 4.5 and the minimum at 4.50
81,920 steps, none below AA.

To compile the theme instead of applying it in the browser, the same color goes in taisho.config.ts:

ts

brand is the only decision you have to make. radius changes the corners and neutral.tint tints the grays with the brand's hue; fonts, spacing and shadows are set in the same file. In the markup, every step is a background class and comes with its text class, the one the engine picked for that step:

html

That HTML doesn't change when the theme does:

Enlarge image:
The same sample screen with three themes: the default one with a black brand, a violet one with round corners and serif headings, and a green one with warm neutrals
Three themes made with the editor on the home page. The screen's HTML is the same in all three.

Your brand color stays in the scale exactly as you wrote it, on the step its contrast puts it on. The exception is a color that, in either mode, lands between two steps and doesn't reach AA, with the text on top of it or against the page background: in that mode it moves as little as it can, to the edge that does, and taisho generate warns you with both contrast ratios. A near-white color is also adjusted, barely, because it's lighter than the lightest step. If you'd rather keep the exact color even when it falls short, you ask for it in the theme:

ts

How many scales move and by how much, the method, the first engine, which failed, and the cases it doesn't cover are in How to generate an accessible color palette from a single color.

Write HTML and the behavior comes with it

The everyday ones are there, like Button, Input, Select, Table, Tabs and Modal, and so are the bigger ones: DatePicker, Combobox, CommandPalette, FileUpload, Slider, Toast, Sidebar. You write all of them the same way, as classes on ordinary HTML. The screen below is the one on the site's home page, built from tabs, a search field, a sortable table, badges, avatars and a toggle.

Enlarge image:
A sample screen in light mode: a Projects heading, three avatars, a New project button, tabs, a search field, a table of five projects with their status, and a notifications toggle
The sample screen from the home page, with the default theme.

Every element that uses the system carries the ts class, and the rest of the classes have no prefix. This is the header of that screen, simplified:

html

The ones that need behavior come with their own JavaScript for the things markup can't do alone: moving focus, answering the arrow keys, keeping aria-selected up to date. In Tabs, for instance, the arrows switch tabs, and on a right-to-left page they swap. The heavier components, like DatePicker or Select, fetch their module only when a page uses them.

Modal and Drawer are built on the native <dialog> and invoker commands (the command and commandfor attributes). The button says which dialog it opens, and the browser opens it:

html

According to MDN's browser-compat-data, invoker commands shipped in Chrome 135, Firefox 144 and Safari 26.2. In those browsers the dialog opens and closes with no JavaScript. In the older ones the system supports, like Chrome and Edge 124 to 134, Core's script runs the same attributes, so the markup doesn't change. Menus and popovers use the Popover API.

Every component page in the docs runs through axe in light and dark mode, and focus and keyboard behavior are tested with real interaction in Chromium, Firefox and WebKit. What those tests don't cover is further down.

Dark mode is built in

Every color step already carries its light value and its dark value, so there's no prefix to repeat on each class. The dark value is computed against the dark background with its own contrast targets, not by flipping the light one. This is one line of the compiled theme for #3b82f6:

css

Dark mode turns on with a dark class on <html>, or follows the operating system with darkMode: 'media' in the config. A section that has to stay dark inside a light page takes scheme-dark. No other class on the page changes.

Enlarge image:
The same sample screen in dark mode, with the same components and the same data
The same screen with the dark class on the html element.

Right-to-left works the same way. The CSS is emitted with logical properties, so ps-base is padding-inline-start and dir="rtl" mirrors the UI without touching the markup. Anything pinned to a physical side, like a toast in the right corner, stays where you put it.

Try it with three lines, install it with three commands

To try it with nothing to install, paste three lines into a page. They load the default theme, the full system and the behavior, with the version pinned in the URL:

html

To use it with your own brand, install the package. The taisho command needs Node 26 or newer:

bash

init asks for your brand, fonts and icons and writes taisho.config.ts. generate compiles the CSS, copies the JavaScript into a taisho/ folder and prints the four lines to paste into your HTML:

html

That folder holds only static files, so any server can serve it. The installation guide has a full page to copy, and the package also ships a Vite plugin if that's what you already use.

Each page downloads only what it uses

taisho generate reads your project's HTML and writes only the CSS for the classes it finds and only the JavaScript modules that HTML uses. A page with a single button, compiled this way, comes out at 9.3 KB gzipped, CSS and JavaScript together. In the comparison in the docs, three pages built with seven systems, each used the way its own documentation recommends, TaishoDS Core comes second on the dashboard and the landing page and third on forms. The figures are KB gzipped, CSS and JavaScript added together:

System and how it's used Dashboard Forms Landing
DaisyUI 5.8.0, purged CSS; Cally for the calendar13.021.58.1
TaishoDS Core, on-demand CSS and only the JavaScript modules the page uses37.142.615.2
Flowbite 4.0.2, purged CSS and the full flowbite.min.js40.740.640.2
Bootstrap 5.3.9, Sass with only the modules used and JavaScript per module; Forms adds flatpickr48.647.023.5
UIkit 3.25.31, uikit-core plus the components used; Forms adds flatpickr67.580.263.1
Web Awesome 3.14.0 (free), with a bundler and each component on its own101.499.258.9
Preline 5.1.0, purged CSS and the full preline.js; Forms adds lodash, which its calendar needs112.2138.1111.0

DaisyUI is smaller on all three, because it solves almost everything in CSS. The full CDN file, which is for trying it without installing anything, is heavier: 81.1 KB with the base of its JavaScript, more than Bootstrap (53.4), Flowbite (55.4) and DaisyUI (65.1), and just under UIkit (82.4). The date, the method and the brotli figures are in the docs.

Errors show up before you deploy

The utilities are a finite set. There are no arbitrary values: p-[13px] doesn't exist, and a spacing, a color or a radius always comes from the theme's scale. The numbers are pixels, so gap-16 is 16 px. Here's the same line in Tailwind and in TaishoDS Core:

html

I didn't write the second one by hand. It's what translate_tailwind, one of the tools in the next section, returns when you give it the first.

A closed vocabulary is a real restriction for anyone used to writing one-off values. What you get for it is that a mistake stops being invisible: a class that isn't in the vocabulary does nothing, and because the vocabulary is finite, that can be checked. npx taisho check does it:

html
text

When a name is close to one that exists, it suggests it, even when the habit comes from another system: for fontsize-12 it answers Did you mean "text-12"?. It also flags as an error one of the components it covers when it's missing a part its JavaScript needs, like the field of a NumberInput: the HTML looks fine, but the component wouldn't work. When any warning is an error it exits with code 1, so it works as a CI step, and --format json returns the same thing for another tool to read. When the default scale isn't enough, you add the missing value to the theme with extend, and it becomes one more named class for the whole project.

The assistant reads the system before it writes

An assistant that hasn't read the system has to guess, and in a closed vocabulary a wrong guess does nothing. There are two ways to have it read the system before it writes, and one to have it check what it wrote.

The package ships an MCP server that starts with npx taisho mcp. It runs on your machine, it only reads, it makes no network calls and it sends no telemetry. You declare it once in your client:

json

It has six tools. list_components and get_component return the catalog and each component's sheet with HTML to copy; search_utilities finds classes by name or by the CSS they produce; get_theme returns the project's colors and scales; translate_tailwind converts Tailwind classes; and validate_markup checks a fragment before it gets written to a file: that the classes exist, that they carry the ts key and that the scale is this system's, and that the Core components it covers, like NumberInput, Tabs, Select or Accordion, aren't missing a part their JavaScript needs. This is what it returns for the flexx <div> above, trimmed to the fields that matter:

json

The third one isn't an error. gap-4 is a valid class and it means 4 px, but if whoever wrote it was carrying another framework's scale they wanted 16, and the assistant finds out before it hands over the markup. taisho check gives it only with --other-scale.

For assistants that don't speak MCP, the site publishes an llms.txt with the rules for writing markup, and one Markdown sheet per component. I tested this with Claude Code and VS Code, and not yet with Gemini or Cursor. The setup for each client is in the AI assistants guide.

What isn't tested yet

Automated tests find a lot, but they can't tell whether what a screen reader announces makes sense, and no component has been through a real one yet: 0 of 56. axe runs with components at rest, without opening menus, dialogs or lists. It hasn't been tested on a real iPhone or iPad either, there's no VPAT, and the browser floor (Chrome and Edge 124, Firefox 125, Safari 17.4) comes from comparing the code with MDN's browser-compat-data, not from testing in those versions. The accessibility page lists what's verified and what isn't.

Try it

The editor is on the home page: type your brand color and the whole page repaints, with the contrast of each step in view.

The source is on GitHub, under the MIT license. If a color, a component or a claim in this post doesn't hold, I'd like to see it in the issues.