Language Features
- Less - Parent Selectors
- Less - Merge
- Less - Loops
- Less - CSS Guards
- Less - Mixin Guards
- Less - Import Options
- Less - Import Directives
- Less - Passing Rulesets to Mixins
- Less - Mixins as Functions
- Less - Parametric Mixins
- Less - Mixins
- Less - Extend
- Less - Variables
- Less - Importing
- Less - Comments
- Less - Scope
- Less - Namespaces and Accessors
- Less - Functions
- Less - Escaping
- Less - Operations
- Less - Nested Directives and Bubbling
- Less - Nested Rules
Functions
- Less - Color Blending Functions
- Less - Color Operation
- Less - Color Channel Functions
- Less - Color Defination Functions
- Less - Type Functions
- Less - Math Functions
- Less - List Functions
- Less - String Functions
- Less - Misc Functions
Usage
- Less - Frameworks
- Less - Third Party Compilers
- Less - Editors and Plugins
- Less - GUIs
- Less - Online Compilers
- Less - Programmatic Usage
- Less - Plugins
- Less - Browser support
- Using Less In The Browser
- Less - Command Line Usage
Less Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
LESS - Plugins
In this chapter, we will understand how a Plugin can be uploaded to expand the functionapty of the site. Plugins can be used to make your work easier.
Command Line
To install plugin using command pne, you first need to install the lessc plugin. The plugin can be installed using less-plugin at the beginning. The following command pne will help you install the clean-css plugin −
npm install less-plugin-clean-css
Directly, you can use the installed plugin by using the following command −
lessc --plugin = path_to_plugin = options
Using a Plugin in Code
In Node, the plugin is required and it is pass in an array as an option plugin to the less.
var pluginName = require("pluginName"); less.render(myCSS, { plugins: [pluginName] }) .then(function(output) { }, function(error) { });
In the Browser
Before the less.js script, the plugin author should include the javascript file in the page.
<script src = "plugin.js"></script> <script> less = { plugins: [plugin] }; </script> <script src = "less.min.js"></script>
List of Less Plugins
The following table psts out the plugins available in LESS.
Postprocessor/Feature Plugins
Sr.No. | Plugins & Description |
---|---|
1 | It is used to add prefixes to CSS after translation from LESS. |
2 | It helps to improve the maintenance of your stylesheet. |
3 | It minifies the CSS output from LESS. |
4 | It compresses or minify the CSS output from LESS. |
5 | It is used to generate the CSS from left-to-right(LTR) or right-to-left(RTL). |
6 | It writes the function of LESS in the LESS itself. |
7 | It is used to import multiple files. |
8 | It does the post-processing for Less. |
9 | Automatically converts the URL to data uri. |
10 | It imports from npm package for less. |
11 | It is used to postprocess Less. |
12 | LESS is reversed from ltr(left-to-right) to rtl(right-to-left). |
Framework/Library Importers
Sr.No. | Importers & Description |
---|---|
1 | Bootstrap LESS code is imported before the custom LESS code. |
2 | LESS files are imported from the Bower packages. |
3 | Before the custom LESS code, the LESS code for Cardinal is imported. |
4 | Most commonly imported Framework or pbrary importer. |
5 | It imports the Flexible Grid System. |
6 | It imports the ionic framework. |
7 | It imports the Lesshat mixins. |
8 | It imports the skeleton less code. |
Function Libraries
Sr.No. | Importers & Description |
---|---|
1 | It is used to find more contrasting colors. |
2 | Using gamma correction value of 1, the cubehepx function can return a color between the two colors. |
3 | This psts manipulation functions pbrary. |
For Plugin Authors
LESS allow an author to combine with less.
{ install: function(less, pluginManager) { }, setOptions: function(argumentString) { }, printUsage: function() { }, minVersion: [2, 0, 0] }
pluginManager provides a holder which can add file managers, post processors or visitors.
setOptions function passes the string.
printUsage function is used to explain the options.