Stylus

Parcel supports stylus files out of the box by utilizing the @parcel/transformer-stylus plugin, under the hood this plugin uses the stylus npm package.

In the default Parcel config, the compiled stylus files are also processed by PostCSS (meaning PostCSS plugins are executed and CSS modules just work: import * as styles from "./style.module.styl";).

ΒΆ Example Usage

Importing stylus in JavaScript/TypeScript

import "./custom.styl";

You can also directly include the stylus file in a HTML file.

<link rel="stylesheet" href="./style.styl" />

Directly compile stylus using the Parcel CLI

parcel build ./style.styl

ΒΆ Configuration

To configure stylus we support the following configuration files: .stylusrc and .stylusrc.js (we highly recommend to use the JSON version whenever possible for the best performance/cache experience)

To see the available options to configure stylus see the official stylus documentation.