🍣 surimi

The next era of
writing CSS

Surimi is the next generation of CSS 'preprocessors'. It combines the flexibility of traditional CSS preprocessors with the power of CSS-in-JS tools. We call it TS-in-CSS: Using TypeScript as a CSS preprocessor.

Why Choose Surimi?

CSS preprocessors like SCSS are great, but with CSS getting more and more features, it's time for a new approach to supercharge CSS. Developers figured out the typing and the programming part already ...with TypeScript.
So let's use TypeScript to write composable, maintainable styles.

Type Safety

Catch CSS errors at compile time with TypeScript's powerful type system. No more runtime surprises.

IntelliSense Everywhere

Get autocomplete, hover information, and inline documentation right in your editor as you type.

Incredible DevEx

Share styles, selectors, themes like you are used to. And if you need, export them to JS with ease. All that with zero runtime.

Zero learning curve

If you already know CSS and TypeScript, you know Surimi. And if not, the information is just one hover away.

See It In Action

CSS is nice and (somewhat) simple. But it's lacking things we're used to in coding, like re-usable selectors, compile-time and type safety, a direct JS interface, composability and other things that make coding great.

This is how surimi solves these issues:

Before
#container {
  display: flex;
  padding: 20px;
  background-color: var(--bg-color);
}

#container > .button {
  color: var(--primary-color);
}

#container > .button:hover {
  color: var(--primary-hover-color);
}
With Surimi
const container = select('#container').style({
  display: 'flex',
  padding: '20px',
  backgroundColor: theme.colors.background,
});

container.child('.button')
  .style({
    color: theme.colors.primary,
  })
  .hover().style({
    color: theme.colors.primaryHover,
  });
Pro Tip: With Surimi, you get full TypeScript type checking, autocomplete for property names and values, and instant feedback on typos or invalid CSS. If you change a selector (like .container), all related styles update automatically.
Ready to get started?

Install Surimi Today

Get up and running in seconds with your favorite package manager

$ npm install surimi
$ yarn add surimi
$ pnpm add surimi

Quick Start

  1. 1 Install Surimi using one of the commands above
  2. 2 Import our vite plugin (works with React, Astro, Vue and more) and use it in your vite config
  3. 3 Create a `.css.ts` file and start using Surimi!
  4. 4 Import the .css.ts file into any other file of your app... done! 🎉
Read the documentation →