CSS ---- css preprocessor

Presentation layer (CSS)

CSS Cascading Style Sheets is a markup language, not a programming language, and therefore can not be custom variables, and other references can not, in other words do not have any syntax support, it is mainly the following defects:

  • Grammar is not strong enough, such as writing can not be nested, leading to the development of modular need to write a lot of choices duplicate device;
  • No reasonable style variable and reuse mechanism, such that the associated value to be repeatedly output in the form of logic literals, making it difficult to maintain;

This leads to a lot of us no reason to increase the workload on the job. To solve this problem, front-end developers will use a technique called [] CSS preprocessor tool that offers CSS style layer multiplexing mechanism missing, reduce redundant code, improve code maintainability style. Greatly improving the efficiency of development on the front-end style.

What is the CSS preprocessor

CSS preprocessor defines a new language, the basic idea is to use a specialized programming language for programming CSS adds some features, the CSS file is generated as a target, then developers will just use this language to encode work of CSS. Converted into plain words, "in a special programming language, style of Web page design, and then converted to normal CSS file by the compiler to use for the project."

Popular CSS preprocessor which

  • SASS: based on Ruby, by server processing, and powerful. High resolution efficiency. Ruby language to learn, difficult to get started than LESS.
  • LESS: Based NodeJS, by the client process, simple to use. Function simpler than SASS, parsing efficiency is lower than SASS, but in the actual development is enough, so we back office staff if necessary, recommend the use of LESS.

Guess you like

Origin www.cnblogs.com/yanxiaoge/p/11078843.html
css