# Stylus

> **TL;DR**
> Available only in IntelliJ IDEA with the Ultimate subscription: [download](https://www.jetbrains.com.cn/en-us/idea/download/) to try or [explore the features](https://www.jetbrains.com.cn/en-us/products/compare/?product=idea&product=idea-ult).
>
>
>
>
>
> Required plugins:
>
>
>
> `Stylus`, `File Watchers` -    install the plugins on the Settings | Plugins page, tab Marketplace.     The plugins are available only in IntelliJ IDEA with the Ultimate subscription.

IntelliJ IDEA lets you translate your [Stylus](http://stylus-lang.com/) code into CSS on the fly.

## Before you start

Procedure:

1. Make sure you have [Node.js](http://nodejs.org/)  on your computer.

2. Install the Stylus and File Watchers plugins on the Settings | Plugins page, tab Marketplace, as described in [Installing plugins from
JetBrains Marketplace](managing-plugins.html#install_plugin_from_repo).     The plugins are available only in IntelliJ IDEA with the Ultimate subscription.

## Install Stylus

Procedure:

* In your command-line shell or in the embedded Terminal (`Alt+F12` (Windows), `⌥ F12` (macOS), `⌥ F12` (IntelliJ IDEA Classic (macOS)), `⌘ ⌃ T` (macOS System Shortcuts), `Alt+F12` (XWin), `Alt+F12` (GNOME), `Alt+F12` (KDE), `Alt+F12` (Emacs), `Alt+F12` (Sublime Text), `⌥ F12` (Sublime Text (macOS)), `Alt+F12` (NetBeans), `Ctrl+Alt+1` (Visual Studio), `⌘ ⌃ 1` (Visual Studio (macOS)), `Alt+F12` (Eclipse), `⌥ F12` (Eclipse (macOS))) , type:

`npm install --global stylus`

Learn more from the [Stylus official website](http://stylus-lang.com/#get-styling-with-stylus).

## Compile the Stylus code

To compile your code automatically, you need to install a compiler and configure a [Stylus File Watcher](#stylus_create_file_watcher) which will track changes to your files and run the compiler.

When you open a file, IntelliJ IDEA checks whether an applicable File Watcher is available in the current project. If such File Watcher is configured but disabled, IntelliJ IDEA displays a popup that informs you about the configured File Watcher and suggests to enable it.

If an applicable File Watcher is configured and enabled in the current project, IntelliJ IDEA starts the compiler automatically upon the event specified in the [New Watcher dialog](new-watcher-dialog.html).

* If the Auto-save edited files to trigger the watcher checkbox is selected, the File Watcher is invoked as soon as any changes are made to the source code.

* If the Auto-save edited files to trigger the watcher checkbox is cleared, the File Watcher is started upon save (`File | Save All`, `Ctrl+S` (Windows), `⌘ S` (macOS), `⌘ S` (IntelliJ IDEA Classic (macOS)), `⌘ S` (macOS System Shortcuts), `Ctrl+S` (XWin), `Ctrl+S` (GNOME), `Ctrl+S` (KDE), `Ctrl+X, Ctrl+S` (Emacs), `Ctrl+S` (Sublime Text), `⌘ S` (Sublime Text (macOS)), `Ctrl+S` (NetBeans), `Ctrl+Shift+S` (Visual Studio), `⌘ ⇧ S` (Visual Studio (macOS)), `Ctrl+S` (Eclipse), `⌘ S` (Eclipse (macOS))) or when you move focus from IntelliJ IDEA (upon frame deactivation).

Learn more from [File Watchers](using-file-watchers.html).

IntelliJ IDEA creates a separate file with the generated output. The file has the name of the source Stylus file and the extension `.css`. The location of the generated files is defined in the Output paths to refresh field of the [New Watcher dialog](new-watcher-dialog.html). However, in the Project Tree, they are shown under the source file which is now displayed as a node.

Procedure: Create a File Watcher

1. In the Settings dialog (`Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS))), click File Watchers under Tools. The [File Watchers page](settings-tools-file-watchers.html) that opens shows the list of already configured File Watchers.

2. Click the ![Add button](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.add.svg) or press `Alt+Insert` (Windows), `⌘ N` (macOS), `⌃ N` (IntelliJ IDEA Classic (macOS)), `⌘ N` (macOS System Shortcuts), `Alt+Insert` (XWin), `Alt+Insert` (GNOME), `Alt+Insert` (KDE), `Alt+Insert` (Emacs), `Ctrl+N` (Sublime Text), `⌘ N` (Sublime Text (macOS)), `Alt+Insert` (NetBeans), `Ctrl+N` (Visual Studio), `⌘ N` (Visual Studio (macOS)), `Alt+Insert` (Eclipse), `⌘ N` (Eclipse (macOS)) and choose the Stylus predefined template from the list.

3. In the Program field, specify the path to the executable file:

* `stylus` for macOS and Unix.

* `stylus.bat` for Windows.

Type the path manually or click ![the Browse button](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.general.ellipsis.svg) and choose the file location in the dialog that opens.

4. Proceed as described in [File Watchers](using-file-watchers.html).

## Configure syntax highlighting

You can configure Stylus-aware syntax highlighting according to your preferences and habits.

Procedure:

1. In the Settings dialog (`Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS))), go to `Editor | Color Scheme | Stylus`.

2. Select the color scheme, accept the highlighting settings inherited from the defaults or customize them as described in [Colors and fonts](configuring-colors-and-fonts.html).

## Configure code style

Procedure:

1. Press `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS)) to open settings and then select `Editor | Code Style | Style Sheets | Stylus`.

2. Use the controls on the [Code Style. Stylus](code-style-stylus.html) to configure code style in Stylus files.

## See also

### Procedures

[File Watchers](using-file-watchers.html) [Minifying CSS](compressing-css.html) [Sass, SCSS, Less, and PostCSS](transpiling-sass-less-and-scss-to-css.html) [Sass and SCSS in Compass applications](transpiling-compass-to-css.html)

### Reference

[File Watchers](settings-tools-file-watchers.html) [New Watcher Dialog](new-watcher-dialog.html)

### External Links

