CSS px Auto turn REM

Source: Internet
Author: User
Tags sublime text postcss


1.CSS Processor

Processors such as Sass, less, and postcss can be processed.

@function Px2rem ($px, $base-font-size:75px) {
@return ($px/$base-font-size) * 1REM;
}

2.CSSREM

This is a plug-in is Flashlizi for sublime text written a plug-in, it is really convenient to use. We can see it on GitHub.

Let me explain how to configure: 2.1 We can download the dependent files on GitHub , 2.2 Open Sublime text, enter the packages directory (Sublime text-Preferences- > Browse Packages); 2.3 Place the Cssrem-master folder in the directory opened in the previous step, restart sublime text to take effect;

We can also modify the default configuration:
Open the Cssrem.sublime-settings file under the Cssrem-master folder to modify
{
    "Px_to_rem": the unit ratio of//px to REM, The default is
    "Max_rem_fraction_length": 6,//px to the maximum length of the number of parts of REM. The default is 6.
    "Available_file_types": [". css", ". Less", ". Sass", ". html"]
    //enable this plug-in file type. The default is: [". css", ". Less", ". Sass"]
}

Create a new. css file:

11.png


Press the TAB key to get the following result:

Processors such as Sass, less, and postcss can be processed. 1.CSS processor

Processors such as Sass, less, and postcss can be processed. 1.CSS processor

Processors such as Sass, less, and postcss can be processed.

Related Article

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.