Home > Article > Development Tools > How to use less in sublime
Using LESS in Sublime Text involves the following steps: Install the LESS plugin Create the LESS file (.less) Write the LESS code Compile the LESS file (optional) Important features of LESS include variables, nesting, and mixins.
Using LESS in Sublime Text
How to use LESS?
Sublime Text is a popular code editor that makes it easy to work with LESS, a CSS extension language. To use LESS, you need to perform the following steps:
1. Install the LESS plug-in:
Ctrl
Shift
P
). Install Package
and select it. LESS
in the search bar and install the plugin. 2. Create a LESS file:
.less
as the extension (for example, mystyle.less
). 3. Write LESS code:
4. Compile LESS files (optional):
Important features in LESS:
Example:
Here is an example of writing a simple style using LESS:
<code class="less">@primary-color: #007bff; body { color: @primary-color; background-color: #f5f5f5; } a { color: darken(@primary-color, 10%); }</code>
This will generate the following CSS:
<code class="css">body { color: #007bff; background-color: #f5f5f5; } a { color: #0063d6; }</code>
The above is the detailed content of How to use less in sublime. For more information, please follow other related articles on the PHP Chinese website!