Skip to main content
Documentation
On this page

Install Cirth for Ember

app/app.js is the browser entry module for an Ember application. A CSS import there is loaded once for the whole document. Ember builds it with Vite through Embroider, using the browsers in config/targets.js; the default current targets preserve Cirth's colours.

Verified with Ember 7.3 on

Four steps: install, import it, keep the targets current and check it.

1 Install #

Package manager
npm install @cirthcss/cirth
pnpm add @cirthcss/cirth
yarn add @cirthcss/cirth
bun add @cirthcss/cirth

2 Import it #

Near the top of app/app.js:

import "@cirthcss/cirth";
import Application from "@ember/application";

Your own app/styles/app.css still loads after it.

3 Keep the targets current #

config/targets.js decides what Vite compiles for. The default, the last version of each browser, keeps light-dark(). If you widen it to browsers older than Cirth's floor (Chrome and Edge 123, Firefox 130, Safari 18.2), the build rewrites those colours and a data-theme subtree stops changing. Compatibility explains this limit for CSS pipelines.

const browsers = [
  "last 1 Chrome versions",
  "last 1 Firefox versions",
  "last 1 Safari versions",
];

module.exports = { browsers };

4 Check it #

Put this forced-dark region in a page or component that uses the global stylesheet:

<section data-theme="dark">
  <article>
    <p>Dark, whatever the system scheme is.</p>
  </article>
</section>

Build for production, then open the page while the system uses a light theme. A dark article proves that Cirth loaded and that data-theme="dark" is working. It remains dark when the system switches to a dark theme. If the article follows the surrounding page instead, the build rewrote Cirth's colours: check config/targets.js above.

Templates render ordinary elements: <article>, <label>, <button> need no classes.

Customization covers the --cirth-* properties; set yours in app/styles/app.css. Package and builds lists the classless, scoped and print entry points. Return to Framework guides for another stack.

Ember is a trademark of Tilde Inc. This site is unaffiliated with the Ember project.

Search documentation

Type at least two characters to search.