postcss-scss
    Overview
    Documentation
    Insights
    Code
    Contributors
    Dependencies
    Alternatives

postcss-scss

SCSS parser for PostCSS

2.0.0  •  Published 1 years ago  •  by postcss  •  MIT License

PostCSS SCSS Syntax Build Status

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-scss

or (if you use Yarn)

yarn add --dev 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.

Ready for the next level?
Join Devstore's founding team to build the world's largest open-source knowledgebase, work with the hottest technologies, and be part of something great

Popularity

Weekly Downloads
1.3M
Stars
419

Maintenance

Development

Last ver 1 year ago
Created 4 years ago
Last commit 1 year ago
8 days between commits

Technology

Node version: 10.6.0
78.7K unpacked

Legal and Compliance

MIT License
OSI Approved
0 vulnerabilities

Contributors

8 contributors
Andrey Sitnik
Maintainer, 139 commits, 6 merges
Works at evilmartians
kushatc
2 commits
Ben Briggs
Maintainer, 1 commits, 1 PRs
David Clark
Maintainer, 1 commits
Works at mapbox
dryoma
1 commits, 1 PRs
Nicolás Serrano Arévalo
1 commits, 1 PRs
Works at nomadcoders

Dependencies

Tags

css
postcss
postcss-syntax
parser
scss
sass
© 2019 Devstore, Inc.
Devstore helps developers find and use open-source packages, so they can focus on building amazing things