Home  >  Article  >  Web Front-end  >  what is node-sass

what is node-sass

coldplay.xixi
coldplay.xixiOriginal
2021-01-13 17:17:105295browse

Node-sass is a library that binds [Node.js] to LibSass; it allows users to natively compile [.scss] files to css at incredible speeds and connect them through the connection intermediate The file is automatically compiled.

The operating environment of this article: Acer S40-51, HBuilderX.3.0.5 version, Windows10 Home Chinese version

Node-sass is a library that binds Node.js to LibSass (C version of the popular stylesheet preprocessor Sass). It allows users to compile .scss files to css natively at incredible speeds, with automatic compilation via connecting middleware.

What is Sass?

Sass is a preprocessor scripting language that can be interpreted or compiled into Cascading Style Sheets (CSS).

Sass consists of two syntaxes: the older syntax uses indentation to separate blocks of code and newlines into separate rules; the newer syntax SCSS uses a block format like CSS. It uses curly braces to represent blocks of code and semicolons to separate lines within a block.

Indented syntax and SCSS files are traditionally given extensions .sass and .scss respectively

How to install Node-sass?

In view of the domestic environment, node-sass is too difficult to install. It can be installed directly through Taobao’s npm image.

1. Install cnpm (https://npm.taobao.org/)

npm install -g cnpm --registry=https://registry.npm.taobao.org

2. Install node-sass in the project folder

cnpm install --save-dev node-sass

Instructions: - -save-dev automatically adds node-sass to package.json in the project folder.

Related free learning recommendations: php programming (video)

The above is the detailed content of what is node-sass. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn