Sublime text 3: install and use the plug-in that converts px to rem, and sublimerem

Source: Internet
Author: User

Sublime text 3: install and use the plug-in that converts px to rem, and sublimerem

Rem is a powerful unit for mobile terminals, so here we will introduce the installation and use of sublime text 3 to convert px to rem plug-ins. If this plug-in is installed, if you enter the number of pixels, sublime will prompt the corresponding rem value, so you don't have to calculate it yourself !!

1. First download the plug-in at this address: https://github.com/hyb628/cssrem.git

2. decompress the downloaded plug-in, open sublime, and find: Sublime Text-> Preferences->Browse Packages: place the decompressed folder to the open file.

3. The plug-in is installed at this time. Enter a value in css and a corresponding prompt will be displayed:

After entering, it is automatically converted:

4. Here, 40 is the default reference value of the plug-in. We can modify it as needed:

In Sublime Text-> Preferences-> Package Settings-> cssrem-> Settings-user, enter the following parameter configuration to modify the reference number and the converted decimal number:

{
"Px_to_rem": 60, // The unit ratio of px to rem. The default value is 40.
"Max_rem_fraction_length": 6, // the maximum length of the fractional part of px to rem. The default value is 6.
"Available_file_types": [". css", ". less", ". sass", ". html"]
// Enable the file type of this plug-in. Default Value: [". css", ". less", ". sass"]
}


After modification, the baseline number is changed:

 

Note: by default, the parameter configuration file is set by default! Enter the corresponding content when you modify it !!

 

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.