Integrations

Set up Master CSS in Angular

Guide to setting up Master CSS in your Angular project.

Create a project

If you don't have an Angular project, create one first.

Terminal
ng new my-appcd my-app

Add Master CSS

Run the installer from the Angular project root. The default is static CSS generated by the CLI; Angular keeps its existing builder.

Terminal
npm create @master/css@rc -- --framework angular --yes

Launch server

Generate CSS once, then keep the CSS watcher running in a separate terminal while the Angular server runs.

Terminal
npx master-css generate --output src/master.generated.cssnpm start

Start using Master CSS

Now style your first template using Master CSS syntax.

localhost:4200

Hello World

src/app/app.component.html
<h1 class="m-2xl italic font-5xl font-heavy text-neutral">Hello World</h1>

The installer creates master.css as the source entry and imports the generated src/master.generated.css from src/styles.css. Keep src/styles.css in Angular's global styles configuration. The generated file is build output; do not edit it or import it from master.css.

Before each production build, regenerate the CSS:

npx master-css generate --output src/master.generated.cssnpm run build

During development, run npx master-css generate --output src/master.generated.css --watch in a separate terminal. Static rendering needs complete class strings in templates or an explicit safelist. CSS custom properties can still supply dynamic values.

For class names created in the browser, use the Angular runtime guide.


© 2026 Aoyue Design LLC.MIT License
Trademark Policy