Thanks to visit codestin.com
Credit goes to github.com

Skip to content
agatronic edited this page Jun 2, 2012 · 4 revisions

Plugins

Dotless has a plugin mechanism which allows dotless to be extended.

Using Plugins

Through the executable

List all the plugins by using the -l command line switch. This will tell you all the plugins installed.

Install a plugin dll by creating a directory in the same folder as the compiler called "plugins" and putting the dll in their. It should now appear in the list of plugins available.

To run a plugin, use the -p parameter. The format is -p:PluginName[:Parameter1=Argument1[,Parameter1=Argument2]]

e.g.

dotless.Compiler.exe -p:Rtl:forceRtlTransform=true,onlyReversePrefixedRules=true

Through the ASP handler

The dotless config section can be expanded to include the plugins, e.g.

<dotless minifyCss="true" cache="false" handleWebCompression="true">
  <plugin name="Rtl">
    <pluginParameter name="onlyReversePrefixedRules" value="false" />
    <pluginParameter name="forceRtlTransform" value="false" />
  </plugin>      
</dotless>

The plugin node takes an additional attribute "assembly" which can specify the name of the assembly to load the plugin from, if it is not one of the bundled dotless plugins.

Example Plugins

Dotless has some plugins included.

  • RTL plugin - for developing stylesheets that work in both LTR and RTL languages
  • ColorSpin Plugin - example plugin that spins all the colours in a stylesheet

Plugins for Developers

Function Plugins - Add functions

Visitor Plugins - Alter the less Abstract Syntax Tree

Plugin Configuration - How to add plugin configuration

Clone this wiki locally