Skip to content

postcss/postcss-scss

Folders and files

NameName
Last commit message
Last commit date

Latest commit

66f77c3 · Jul 18, 2024
Sep 8, 2023
Sep 28, 2023
Sep 8, 2023
Jul 16, 2018
Jan 10, 2022
Jan 10, 2022
Sep 28, 2023
Aug 9, 2015
Jul 7, 2022
Sep 28, 2023
Jul 18, 2024

Repository files navigation

PostCSS SCSS Syntax

A SCSS parser for PostCSS.

This module does not compile SCSS. It simply parses mixins as custom at-rules & variables as properties, so that PostCSS plugins can then transform SCSS source code alongside CSS.

Sponsored by Evil Martians

Install

npm --save install postcss postcss-scss

Usage

There are two ways to use this parser:

1. SCSS Transformations

The main use case of this plugin is to apply PostCSS transformations directly to SCSS source code.

For example, you can lint SCSS source with Stylelint and linter will automatically fix issues in the source.

// postcss.config.js
module.exports = {
  syntax: 'postcss-scss',
  plugins: {}
}

2. Inline Comments for PostCSS

Also you can use this parser just to add // single-line comment to your PostCSS project (without any Sass):

:root {
    // Main theme color
    --color: red;
}

Note that you don’t need a special stringifier to handle the output; the default one will automatically convert single line comments into block comments.

// postcss.config.js
module.exports = {
  parser: 'postcss-scss',
  plugins: {}
}

If you want Sass behaviour with removing inline comments, you can use postcss-strip-inline-comments plugin.

Security Contact

To report a security vulnerability, please use the Tidelift security contact. Tidelift will coordinate the fix and disclosure.