Stylus (CSS pre-compiler)

Source: Internet
Author: User

Recommended to Zhang Xin Asahi great god here to learn more: http://www.zhangxinxu.com/jq/stylus/

Installation

NPM Install-g Stylus

Automatic compilation
$ stylus-w Demo.styl-o dist/demo.styl is a styl file, dist is the directory file name to generate the style,-W is the automatic watch file,-O is the output of the compiled CSS file to the specified file

Compression

Stylus--compress < test.styl > test.css//stylus files compiled and compressed into CSS files

Import (@import)

@import "./demo1"

Variable (Variables)

font-size = 14pxbody  font font-size Arial, sans-seri
{  font:14px Arial, sans-seri;}

Media (@media)
--stylus--

. widget  padding 10px@media screen and (min-width:600px)  padding 20px

--css--

{  padding: 10px;}  {  . widget {    padding: 20px;  } }

It seems to pass the file, there are initialization style, and compatible with the style of two small files, not sent, the message I will be OK.

Stylus (CSS pre-compiler)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.