dotless

repository·master·Indexed 20 days ago

https://github.com/dotless/dotless

A Less compiler for .NET. It is available via multiple NuGet packages: dotless.Core for compiler logic, dotless.AspNetHandler for on-the-fly ASP.NET compilation, and dotless.CLI for command-line usage. Supports .NET Framework 4.5.1, 4.6.1, 4.7, and .NET Standard 2.0. For ASP.NET Core integration, the WebOptimizer.Dotless project is recommended.

Tokens
1.8K
Snippets
10
Records
14
Agent score
72%

What's inside dotless

  1. Use dotless with ASP.NET Core

    master

    The main dotless repository does not provide a direct handler for ASP.NET Core. Instead, use the WebOptimizer.Dotless project to integrate Less compilation into ASP.NET Core applications.

    https://github.com/twenzel/WebOptimizer.Dotless
  2. Use Buttons in HTML

    master

    The Buttons plugin provides CSS styling for both <button> and <a> elements. You can apply the .button class to these elements and use modifier classes like .positive or .negative to change their visual state. The plugin is designed to work with icon images located in the plugin's icon directory.

    <!-- Submit button with positive styling and icon -->
    <button type="submit" class="button positive">
      <img src="css/blueprint/plugins/buttons/icons/tick.png" alt=""/> Save
    </button>
    
    <!-- Link styled as a button -->
    <a class="button" href="/password/reset/">
      <img src="css/blueprint/plugins/buttons/icons/key.png" alt=""/> Change Password
    </a>
    
    <!-- Link styled as a negative button -->
    <a href="#" class="button negative">
      <img src="css/blueprint/plugins/buttons/icons/cross.png" alt=""/> Cancel
    </a>
  3. Check .NET Framework compatibility

    master

    Starting with version 1.6, dotless supports the following frameworks:

    • .NET Framework 4.5.1
    • .NET Framework 4.6.1
    • .NET Framework 4.7
    • .NET Standard 2.0 (.NET Core 2.0, Mono 5.4, .NET Framework 4.6.1+)

    Note: If your application or library is incompatible with these versions, you must use version 1.5.3.

  4. Choose the right dotless NuGet package

    master

    dotless is split into several packages depending on your integration needs. Choose the one that matches your project type:

    • dotless.Core: Use this if you only need the Less compiler logic.
    • dotless.AspNetHandler: Use this if you are using ASP.NET and want to compile .less files on the fly using a handler.
    • dotless.CLI: Use this if you want a command-line interface (console application) to compile .less files.
    • dotless: This is a backward-compatible package that includes both dotless.Core and dotless.AspNetHandler. It is recommended to upgrade to the specific packages above if you do not need both.
  5. Use the Link Icons plugin

    master

    The Link Icons plugin provides icons for links based on their protocol or file type. To use it, include the plugin's stylesheet in your HTML <head> section.

    Note: This plugin is not supported in Internet Explorer versions earlier than 7.

    <link rel="stylesheet" href="css/blueprint/plugins/link-icons/screen.css" type="text/css" media="screen, projection">
  6. Resolve PowerShell execution policy issues

    master

    If you are unable to execute the build.ps1 script due to security restrictions, you may need to change your PowerShell execution policy. Run the following command in a PowerShell window with Administrator privileges:

    Set-ExecutionPolicy remotesigned
  7. Configure dotless settings in web.config

    master

    The dotless configuration section allows you to control how LESS files are processed and served. You can add a <dotless /> element within your web.config to set the following options:

    • minifyCss: (Boolean) Determines if the output CSS should be minified. Defaults to false in this template.
    • cache: (Boolean) Determines if the processed CSS should be cached. Defaults to true in this template.
    • web: (Boolean) Specifies if the environment is a web environment. Defaults to false in this template.
    • strictMath: (Boolean) Determines if strict math mode is enabled for LESS expressions. Defaults to false in this template.
    <dotless minifyCss="false" cache="true" web="false" strictMath="false" />