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 !!