Less. The dynamic stylesheet language.

Overview

Twitter Follow


Chat with Less.js users and contributors

This is the Less.js monorepo, managed via Lerna.

More information

For general information on the language, configuration options or usage visit lesscss.org.

Here are other resources for using Less.js:

Contributing

Please read CONTRIBUTING.md. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Reporting Issues

Before opening any issue, please search for existing issues and read the Issue Guidelines, written by Nicolas Gallagher. After that if you find a bug or would like to make feature request, please open a new issue.

Please report documentation issues in the documentation project.

Development

Read Developing Less.

Release History

See the changelog

Contributors

Code Contributors

This project exists thanks to all the people who contribute. [Contribute].

License

Copyright (c) 2009-2017 Alexis Sellier & The Core Less Team Licensed under the Apache License.

Comments
  • The way Extend works - more complicated selectors and change in matching

    The way Extend works - more complicated selectors and change in matching

    From @DesignByOnyx

    I have finally gotten around to testing this and wanted to post my initial findings. I have been using the alpha version less-1.4.0-alpha.js on the client-side only (no command line yet - not that it should be any different really).

    So far, everything works as I would expect except for two major drawbacks which can be explained with one example. Take the following code which is located in one of my root LESS files:

    .container { margin: 0 auto; }
     .container.positioned { position: absolute }
    
    @media screen and (min-width: 30em) {
        .container.positioned { left: 50%; }
    }
    @media screen and (min-width: 30em) and (max-width: 48em) {
        .container { width: 30em; }
        .container.positioned { margin-left: -15em; }
    }
    @media screen and (min-width: 48em) and (max-width: 60em) {
        .container { width: 48em; }
        .container.positioned { margin-left: -24em; }
    }
    @media screen and (min-width: 60em) {
         .container { width: 60em; }
         .container.positioned { margin-left: -30em; }
    }
    

    Issue 1 - styles defined within media queries do not get extended. Anything trying to extend the .container class only gets the margin: 0 auto styles.

    .some-element:extend(.container);
    

    Issue 2 - compound selectors do not get extended. However, the first participant DOES get extended. For example, the following incorrectly extends the .container styles but not the intended .container.positioned styles.

    .some-element:extend(.container.positioned);
    

    I wish I could provide a solution. Hope this helps.

    bug medium priority 
    opened by lukeapage 158
  • Allow parametrized mixins as detached rulesets to form 'lambdas'

    Allow parametrized mixins as detached rulesets to form 'lambdas'

    It seems that currently LESS only supports 'pure' rulesets to be passed along as mixin arguments or stored in variables as detached rulesets.

    I suggest to extend this support to incorporate parametrized mixins, essentially giving LESS the capability to work with lambdas.

    E.g. One would be able to write

    .list {
      .forEach(foo bar baz, (@item, @index) {
        @i : (@index + 1);
        > li:nth-child(@{i}):before {
          content : "@{item}";
        }
      });
    }
    

    where .forEach is defined as

    .forEach(@list, @lambda) {
      @n : length(@list);
    
      .for(0)
      .for(@index) {}
      .for(@index) when (@index < @n) {
        @lambda(extract(@list, @index), @index);
        .for(@index + 1);
      }
    }
    

    Lambda mixin support would also neatly resolve recurring issues with function return arguments and the ugly hack where variables 'bubble up' to parent scope if said variables are as of yet undefined in said parent scope.

    The suggested practice could become to adopt continuation style programming; passing 'return values' along into a lambda mixin to continue down the scope chain. This kind of mechanism is more transparent to users, less brittle by avoiding issues with potential variable name collisions and just fits in better with the overall functional programming paradigms that the LESS syntax is built on.

    [EDIT] Having just had a look at the way detached rulesets and calls are implemented in the AST, I think very little needs to happen to make this work. Even on the parser side of things, it seems fairly simple to just parse an optional block of mixin.args before blockRuleset in the detachedRuleset parser function and pass the arguments along to the tree.DetachedRuleset node instance. (The tree.DetachedRuleset would need to be extended with the params evaluation from tree.mixin.Definition, ofcourse.)

    feature request medium priority needs decision 
    opened by rjgotten 118
  • variable in @import statement

    variable in @import statement

    The lastest version introduced the possibility to "access the value of an abstract property from a string using { } operators" (section "String interpolation" in http://lesscss.org/#-string-interpolation).

    But the problem is that it doesn't work in import statements. It would be great to write code such like this :

    //define the template @mainTemplate: "BaseTheme";

    //import the template @import "_templates/@{mainTemplate}/Config/_ConfigTemplateDefault.less";

    I don't know if it is possible to resolve this issue, but it would be great !

    feature request high priority 
    opened by arnaudgaudin 111
  • How to handle Maths

    How to handle Maths

    1. We decided on strict maths going forward but there is general unease about forcing () around every calculation
    2. I don't think we want to change things massively or go back to the drawing board

    See #1872

    Possibility to add another case for calc which like font, with strict mode off, essentially turns strict mode on for a rule ? Too many exceptions in the future?

    @seven-phases-max : Well, there're a lot of other possibilities, e.g. ./ or require parens for division (e.g. 1/2->1/2 but (1/2)->0.5) etc... Also, the "special cases" (e.g. properties where x/y can appear as shorthand) are not so rare (starting at padding/margin and ending with background/border-radius and eventually there can be more) so we just can't hardcode them all like it's done for font (and because of that I think that the current font "workaround" is just a temporary and quite dirty kludge that ideally should be removed too).

    feature request high priority 
    opened by lukeapage 102
  • Version 3.10.x uses significantly more memory and is significantly slower than 3.9.0

    Version 3.10.x uses significantly more memory and is significantly slower than 3.9.0

    Our builds recently started failing because we run about 80 Less builds in parallel during our project's build process and the new version of Less.js uses so much memory that Node crashes. We traced the crash to upgrading from Less.js from 3.9.0 to 3.10.3.

    I changed our Less script to compile the files sequentially (building 2 files at a time) and sampled Node's memory usage during the process and got the following results:

    less graph

    Less.js seems to use 130% more memory now and takes about 100% longer to compile for us.

    Just wondering if you've benchmarked Less.js and whether you see similar results

    opened by PatSmuk360 95
  • Public variables on namespaces

    Public variables on namespaces

    I realize this isn't a new topic but it I think the time has come to consider implementing public variables on namespaces. Many prominent libraries for LESS (bootstrap, hat, etc.), have emerged, each with dozens of configuration variables which could very well overlap and conflict with each other.

    Currently, namespaces support private variables, the only way to get at them is via mixins within the namespace and those mixins can then be used externally; Sort of like a closure:

    #ns {
        @size: 10px;
        .box() {
            width: @size;
            height: @size;
        }
    }
    
    .icon {
        #ns > .box();
    }
    

    Which yields:

    .icon {
        width: 10px;
        height: 10px;
    }
    

    However, I think it would be very handy to do the following:

    #ns {
        @size: 10px;
    }
    
    .icon {
        width: #ns > @size;
        height: #ns > @size;
    }
    

    As well as update those variables within the namespace:

    #ns > @size: 20px;
    
    feature request medium priority 
    opened by Soviut 95
  • Add Sass like extend

    Add Sass like extend

    Sass extend is here. http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#extend

    More simple syntax, use +.

    .foo {
      width: 100px;
    }
    .bar {
      +.foo;
    }
    

    converted this.

    .foo, bar {
      width: 100px;
    }
    

    See also test code.

    feature request high priority 
    opened by hokaccha 82
  • Support file globbing for @imports

    Support file globbing for @imports

    See: https://github.com/isaacs/node-glob, and ~~https://github.com/isaacs/minimatch~~ https://github.com/jonschlinkert/micromatch

    I use these often in projects. It would be pretty awesome to be able to do the following and not have to specify individual files:

    @import "mixins/*.less";
    @import "components/**/*.less"; 
    

    After only a few minutes of using these patterns they become second nature. It might even help with some of the other import issues.


    Implemented via plugin: less-plugin-glob.

    feature request medium priority up-for-grabs 
    opened by jonschlinkert 70
  • Import options

    Import options

    We have decided that the best way to handle the import bugs is by having options.

    Given the scope of the bugs I feel strongly that the options need to be inline with the actual import statement

    I suggest removing @import-once and @import-multiple and allowing options to be passed to the @import statement

    Note that import can already be followed by media statements e.g.

    @import "file.css" (min-width:400px);
    

    The options I propose we support are

    1. treat as less or treat as css - people have to add ?.css onto the end of url's at the moment to treat as css - a bit of a hack
    2. import-multiple to replace @import-multiple though not so important if we want to drop
    3. whether to keep the import in place or import it - at the moment we keep css imports inline, but it would be nice to be able to include in css files (treated as an anymous node)
    4. The ability to include a less file, but not output anything - just make the classes available as mixins.

    so here are some options.

     @import (multiple: true, less: true, include: true) "file.less" (min-width:400px);
    

    downsides are its a bit confusing with the media query syntax. we could also put the options second and mix them with the media query, defining our own special media query options essentially, but I don't like that in case we conflict in the future with css.

    from @jonschlinkert

    @options (multiple: true, less: true, include: true) {
        @import "file.less" (min-width: 400px);
    }
    

    and variations on the above, such as using closer media query syntax like

    @import (multiple: true) and (less: true) "file.less";
    

    I initially disliked @jonschlinkert's options idea, but it does actually allow for setting defaults.. what I don't like is that it looks a bit verbose.

    we could also assume :true and have

    @import (multiple, less) "file.less" (min-width:400px);
    

    and I am open to any other suggestions.

    feature request high priority 
    opened by lukeapage 68
  • Mixins should accept LESS blocks

    Mixins should accept LESS blocks

    It would be helpful if mixins had access to a content block passed to them, so one could encapsulate media queries or browser hacks in a central place and reference them symbolically.

    This is basically the "Passing Content Blocks to a Mixin" feature of SASS: http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#mixin-content

    In LESS this would mean something like:

    .mobile() {
      @media all and (max-device-width: 480px) {
        @content
      }
    }
    .big-desktop-button {
      ...
      .mobile {
        display:none;
      }
    }
    
    feature request medium priority needs decision 
    opened by rbu 65
  • Class constructor FileManager cannot be invoked without 'new'.

    Class constructor FileManager cannot be invoked without 'new'.

    It seems that v3.10.0 breaks my build, webpack logs below:

    ERROR in ./src/pages/score/components/current/no-join/index.less
    Module build failed (from ./node_modules/[email protected]@mini-css-extract-plugin/dist/loader.js):
    ModuleBuildError: Module build failed (from ./node_modules/[email protected]@less-loader/dist/cjs.js):
    
    
    Class constructor FileManager cannot be invoked without 'new'
          in undefined (line undefined, column undefined)
        at runLoaders (/home/admin/build/node_modules/[email protected]@webpack/lib/NormalModule.js:313:20)
        at /home/admin/build/node_modules/[email protected]@loader-runner/lib/LoaderRunner.js:367:11
        at /home/admin/build/node_modules/[email protected]@loader-runner/lib/LoaderRunner.js:233:18
        at context.callback (/home/admin/build/node_modules/[email protected]@loader-runner/lib/LoaderRunner.js:111:13)
    

    Everything is ok when downgrade to v3.9.0, please investigate this issue and hope to fix it as soon as possible.

    opened by micooz 64
  • Remove PhantomJS stuff

    Remove PhantomJS stuff

    I saw this and though, nobody is using phantomjs. it's a headless browser that no real user is using. it was based on webkit and the development have been discontinued. think you should remove this kind of things and instead use something like puppeteer or something.

    https://github.com/less/less.js/blob/eefe33a47f6fdcc228817df7435a1770ce9e51ea/packages/less/src/less-browser/index.js#L49-L56

    PhantomJS is depricated and should not be used anymore.

    opened by jimmywarting 0
  • Global Variables with a literal

    Global Variables with a literal "." in the value causes the variable to be undefined

    To reproduce: This can be reproduced using the CLI or the programmatic API. Assuming that LESS is already installed, it is most straightforward to reproduce using the CLI:

    echo "body { color: @buildVersion; }" | npx lessc --global-var="buildVersion=a.hello" -
    

    On the other hand, removing the literal period allows this to work:

    echo "body { color: @buildVersion; }" | npx lessc --global-var="buildVersion=hello" -
    

    LESS Code:

    body { color: @buildVersion; }
    

    Current behavior: The LESS compiler throws an error that the global variable is undefined.

    Expected behavior: The LESS compiler should not throw an error and the global variable should be defined.

    Environment information:

    • less version: 3.5.0 - 4.1.3 (current)
    • nodejs version: 16.13.2
    • operating system: Windows

    Appears to have been introduced in 3.5.0. Version 3.0.4 appears to be working fine.

    bug 
    opened by rdwoodring 0
  • Support for recently added CSS functionality container-queries

    Support for recently added CSS functionality container-queries

    As pointed out by @treponat, it seems support for @container queries should be implemented in less.

    By tomorrow (12/12/2022) Firefox will release 108 with support for container queries, completing all the major browsers support for the feature.

    Discussed in https://github.com/less/less.js/discussions/3759

    Originally posted by treponat November 3, 2022 Recently some of the browser started to support a new feature that would allow to create responsive design based on the parent element rather than client's viewport. https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Container_Queries It would be wonderful if LESS would also start to fully support this feature. Currently you can use container functionality in .less files, but the hierarchical structure of css blocks is not working as expected for the container syntax. for example

    .widget.discoverresults, .widget.repositoriesresults {
            container-type: inline-size;
            @container (max-width: 350px) {           
                        .cite {
                            .wdr-authors {
                                display: none;
                             }
                    }
             }
    }
        
    

    would produce this css blocks

    .widget.discoverresults,
    .widget.repositoriesresults {
      container-type: inline-size;
    }
    @container (max-width: 350px) {
      .cite .wdr-authors {
        display: none;
      }
    }
    

    instead of

    .widget.discoverresults,
    .widget.repositoriesresults {
    	container-type: inline-size;
    }
    
    @container (max-width: 350px) {
    
    	.widget.discoverresults,
    	.widget.repositoriesresults {
    		.cite .wdr-authors {
    			display: none;
    		}
    	}
    }
    
    opened by sneridagh 1
  • Nested @media blocks are combined in a non-compliant way.

    Nested @media blocks are combined in a non-compliant way.

    According to the CSS spec, media type (screen, print etc) must be first on the list and all the other conditions (for example (max-width: 800px)) must follow after the media type.

    To reproduce:

    @media (max-width: 800px) {
      @media screen {
        .selector {color: black}
      }
    }
    

    Current behavior:

    Less compiler combines nested media conditions in a way that is not compliant with the spec, putting media type between conditions or after them.

    @media (max-width: 800px) and screen {
      .selector {
        color: black;
      }
    }
    

    Expected behavior:

    Media type should be put into the first position in the media query, like so:

    @media screen and (max-width: 800px) {
      .selector {
        color: black;
      }
    }
    

    Environment information:

    • less version: 4.1.3, including the official playground
    • nodejs version: any
    • operating system: any

    Additional notes

    Even though it might seem trivial to re-order the example above to produce correct results, it's not always possible since the inner @media screen might come from a third party (I'm working with antd) that I can't modify.

    It seems like most browsers don't mind media conditions being out of spec (or I didn't observe the effects), however this issue prevents me from using https://parceljs.org/ which implements pretty strict standards checking and chokes at the less output, producing Unexpected token Ident("screen"). The fixed snippet where media-type comes first is processed correctly by parcel.

    bug 
    opened by tsx 0
  • allow image-size accept Url parameter

    allow image-size accept Url parameter

    What: image-size, image-width, image-height can accept parameter like url(a.png)

    Why: I can write code like

    .xxx{
         background: url(a.png);
         width: image-width($background);
    }
    

    else I have to write:

    @img: 'a.png'
    .xxx{
         background: url(@img);
         width: image-width(@img);
    }
    

    How:

    Checklist:

    • [ ] Documentation
    • [x] Added/updated unit tests
    • [x] Code complete
    opened by heroboy 0
  • fix faulty source map generation with variables in selectors

    fix faulty source map generation with variables in selectors

    Note to reviewer: There are two potential solutions here, one that fixes the specific issue linked, and one that might be a bit more robust. Filter down to the first commit for the bandaid fix, second commit for the more robust one, third commit for added test. I recommend hiding whitespace changes in the GitHub UI – my editor removed a bunch of unnecessary trailing spaces

    PR Template

    What:

    Fixes https://github.com/less/less.js/issues/3567

    Source maps are pointing to the wrong files, and it seems that it points at different files on different runs, causing non-deterministic source map output.

    Checklist:

    • [x] Documentation - N/A
    • [x] Added/updated unit tests
    • [x] Code complete

    Why and How are included in the below description, which details the problem in the code and the proposed solutions.

    Investigation and the problems

    Bear with me a bit, this was my first venture into the less source code 🙂

    We were seeing that we got weird source map output, mapping to files that shouldn't even appear in the source maps (e.g. reference imports from which nothing was used). After digging, there are a couple of problems that are causing this whole issue.

    Background information

    I was able to narrow down my search a bit by finding when this bug was introduced. It was released in 3.5.0-beta.2, and the bug was introduced in https://github.com/less/less.js/pull/3227.

    We were seeing this happen when a selector included a variable, which directed me to this bit: https://github.com/less/less.js/pull/3227/files#diff-d8c0204835f49ae90096efe1e2d0d80868e0e6214bfd4c960a097eb20cc14ec9R67-R83

    It looks like what this is doing is recreating the selector CSS with the "variableCurly" node replaced with the variable's value. Then it parses that newly created CSS, and replaces the old Selector node(s) with the new one(s). It looks like the code is trying to preserve source information by passing in the fileInfo and index of the original selectors to parseNode: https://github.com/less/less.js/blob/eefe33a47f6fdcc228817df7435a1770ce9e51ea/packages/less/src/less/tree/ruleset.js#L85-L86

    For a little more context, my understanding is that parseNode is used for creating new nodes after the original input files are parsed.

    First problem

    In parseNode, the provided currentIndex and fileInfo are added to the newly created node(s) here: https://github.com/less/less.js/blob/eefe33a47f6fdcc228817df7435a1770ce9e51ea/packages/less/src/less/parser/parser.js#L111-L112

    These lines assume that result is a tree node. However, in some cases, result is actually an array of nodes. So when it tries to add the source info from the old selectors to the new ones, it's actually just setting _index and _fileInfo properties on the array itself, so it doesn't actually ever make it to the source maps. In this case, the parseList is ["selectors"], so result is an array of Selector tree nodes.

    Second problem

    Selector nodes have an elements array, containing the elements that make up the selector. When a Selector is added to the output, it actually does so by generating the CSS for each of its elements: https://github.com/less/less.js/blob/eefe33a47f6fdcc228817df7435a1770ce9e51ea/packages/less/src/less/tree/selector.js#L135-L138

    This means that if the _fileInfo or _index for the Selector's elements is incorrect, then the output source map will be incorrect. That also means that even if the _fileInfo and _index were correctly set on the Selector(s) rather than the array containing the Selector(s), the source maps would still be incorrect on the Elements that make up the selector. The source info for the elements gets set here: https://github.com/less/less.js/blob/eefe33a47f6fdcc228817df7435a1770ce9e51ea/packages/less/src/less/parser/parser.js#L1299

    There are two problems here:

    1. The currentIndex passed into parseNode doesn't get added to the created Elements index
    2. That fileInfo is not the fileInfo that gets passed into parseNode. It's the fileInfo that's given to the Parser when it's instantiated: https://github.com/less/less.js/blob/eefe33a47f6fdcc228817df7435a1770ce9e51ea/packages/less/src/less/parser/parser.js#L41

    The proposed solution(s)

    I have two proposals for how we can solve this. One is more of a bandaid fix, and the other is (I believe) a bit more robust. Both solutions include the fix for where _fileInfo and _index get set on an array.

    1. Bandaid fix by going through the elements for each selector returned by parseNode, and update the _fileInfo and add the currentIndex to the _index for each one.
    2. Instead of calling this.parse.parseNode and relying on parseNode to update the _index and _fileInfo of the created nodes, create a new Parser object each time we want to call parseNode. This removes the currentIndex and fileInfo params for parseNode, and adds a currentIndex param to the Parser itself. All nodes created by the parser will add currentIndex (which defaults to 0) to the index from parserInput. This way, we can ensure that any nodes created with parseNode will have the correct source information.

    The first proposed solution can be seen by filtering to the first commit, and the second proposed solution can be seen by filtering to both the first and second commits. The third commit adds a test to ensure that selectors with variables in them have properly generated source maps. I recommend hiding whitespace changes in the GitHub UI – my editor removed a bunch of unnecessary trailing spaces.

    opened by pgoldberg 1
Releases(v4.1.3)
  • v4.1.3(Jun 9, 2022)

    • #3673 Feat: add support for case-insensitive attribute selectors (#3673) (@iChenLei)
    • #3710 Feat: add disablePluginRule flag for render() options (#3710) (@broofa @edhgoose)
    • #3656 Fix #3655 for param tag is null (#3658) (@langren1353)
    • #3658 Fix #3646 forcefully change unsupported input to strings (#3658) (@gzb1128)
    • #3668 Fix change keyword plugin and import regexp (#3668) (@iChenLei)
    • #3613 Fix #3591: refactor debugInfo from class to function (#3613) (@drdevlin)
    • #3716 Fix https failures on macOS (#3716) (@joeyparrish)
    Source code(tar.gz)
    Source code(zip)
  • v4.1.2(Oct 14, 2021)

  • v4.1.1(Jan 31, 2021)

  • v4.1.0(Jan 10, 2021)

    Mixin parentheses requirement removed

    This was maybe too big a change without some kind of deprecation or conversion. So for this version, this works again:

    .mixin;
    
    • #3582 Fix #3576 import redirects. Replace native-request with needle. (#3582) (@zaquest)
    • #3583 Update rollup and other build dependencies (#3583) (@pravi)
    • #3588 Roll back paren requirement on mixin calls (#3588) (@matthew-dean)
    Source code(tar.gz)
    Source code(zip)
  • v4.0.0(Dec 18, 2020)

    This release has 2 breaking changes:

    Parentheses required for mixin calls

    This aligns it with syntax for calling detached rulesets.

    Example

    .mixin() {}
    .mixin;  // error in 4.0
    

    Parens-division now the default math setting

    Parentheses are required (by default) around division-like expressions, to force math evaluation.

    Example:

    @ratio_large: 16;
    @ratio_small: 9;
    
    /** The following will produce `device-aspect-ratio: 1.77777778` by default in 3.x */
    @media all and (device-aspect-ratio: @ratio_large / @ratio_small) {
       .body { max-width: 800px; }
    }
    

    Produces:

    @media all and (device-aspect-ratio: 16 / 9) {
      .body {
        max-width: 800px;
      }
    }
    

    You can, of course, get old math behavior. See: http://lesscss.org/usage/#less-options-math

    What's New

    • min() / max() functions can pass-through if it cannot be evaluated in Less
    • isdefined() can be used to test if variables are defined (e.g. isdefined(@unknown))
    • New rgb color syntax supported (e.g. rgb(0 128 255 / 50%))
    Source code(tar.gz)
    Source code(zip)
  • v2.5.1(May 21, 2015)

    • Fix problems with less being async in some browsers
    • Minor fix only likely to affect programmatic usage of ruleset find
    • Fix error when a namespaced mixin is invoked in global scope
    Source code(tar.gz)
    Source code(zip)
  • v2.5.0(May 21, 2015)

    • supports the scoped @plugin directive to load function plugins
    • All directives are bubbled (e.g. supports), not just media
    • Performance improvements to the parser - should help non-chrome browsers with very large less files to be a lot quicker.
    • the image size function respects include paths like other file functions
    • colour functions take a relative argument that applies percentages relatively instead of absolutely
    • include paths now allows : as a separator on windows (recognising and not splitting drive names by the backslash)
    • @import (css) does not pull the directive above comments
    • Fix for import statements without quotes sometimes causing issues
    • replace supports dimensions and colours
    • the browser field is set in the package.json for use with browserify
    • another fix to support paths being passed as a string instead of an array
    • detached rulesets can be used as default arguments
    • Fix a lot of false warnings about extends
    • errors written to stderr more consistently
    • consistently keep units if strict units is off
    • Better support for comments in function all arguments
    Source code(tar.gz)
    Source code(zip)
  • v2.4.0(May 21, 2015)

    • Support for plugins that pre-process (to add libraries silently etc.)
    • Empty sourcemaps now work
    • Extract and Length functions now ignore comments in a list (more work to come to fix the general problem)
    • fragment urls are treated absolute since they refer to the html document
    • Extends on a selector joined with & now work better
    • Nested mixins work better with !important (regression in 2.3.0)
    • The promise dependency is now actually optional (introduced in 2.0.0)
    • Files with just \r newlines now process ok (regression in 2.0.0)
    • When strict units is off and the unit is 1/x, (e.g. 1 / 12px) the unit output is x, previously nothing (regression in 2.0.0)
    Source code(tar.gz)
    Source code(zip)
  • v2.3.1(Jan 28, 2015)

  • v2.3.0(Jan 28, 2015)

    • add isruleset function
    • add optional import option, causing less to not fail if file not found
    • Fix browsers-side cache.
    • Many fixes to import reference - support @support and keyframe
    • Selectors now interpolate pseudo selectors (e.g. :@{hover})
    • Fix comments missed off if they were at the end of the file
    • Fix !important used with parametric mixins
    • Emits warnings for extends when the target is not found
    • include-path now works on data-uri
    • variables and function calls work for path in data-uri
    • Fix absolute paths not working on imports sometimes.
    • Unicode BOM removed again
    • Misc. bug fixes
    Source code(tar.gz)
    Source code(zip)
  • v2.2.0(Jan 4, 2015)

    • do not apply relative paths to svg-gradient and data-uri functions data-uri output
    • using import filename interpolation and import inline together now works
    • deprecate the compression option (still works, but outputs a warning unless silent)
    • The node version of less now has image-size, image-width, image-height which return the image dimensions of a file
    • Fixed an issue that could cause the parse to occur more than once and the callback be called multiple times
    • if you are outputting to the console, lessc defaults to silent so warnings do not end up in output
    • isunit function supports '' to test if a dimension has no unit
    • data-uri function now counts characters after base64 encoding instead of bytes before encoding to determine ie8 support
    • fix bug effecting guards on pseudo class selectors
    • do not cache on the browser when used with modifyVars
    • detection if less does not parse last character in file
    • detection of whether a file is css now requires /css, .css, ?css, &css instead of just css. You can still tell less the type of file using import options.
    • remove extra new line added to sourcemap entry inline file
    • support safari extension
    • less.parse now exposes a way to get the AST. We do not recommend you use this unless you need to.
    Source code(tar.gz)
    Source code(zip)
  • v2.1.2(Jan 4, 2015)

  • v2.1.1(Jan 4, 2015)

    • Improved keyword and anonymous usage with the replace function
    • Added getCSSAppendage to sourcemap builder to avoid duplication in plugins
    • Fix problem with plugins when used with the promises version of render
    • If the render callback throws an exception it now propogates instead of calling the callback again with an error
    Source code(tar.gz)
    Source code(zip)
  • v2.1.0(Nov 23, 2014)

    • Fixed isSync option, it was using sync file operations but promises are guaranteed to call back async. We now support promises as a feature rather than the 1st class way of doing things.
    • Browser code is now synchronous again, like in v1, meaning it blocks the site until less is compiled
    • Some fixes for variable imports which affected filemanagers when synchronous
    • Fixed lessc makefile dependencies option
    • output now reports back a imports field with an array of imported files
    • relative path test for drive names (so windows only) is now case insensitive
    • Fix for IE7 - use getChar instead of indexing array
    • variables using !important now output !important, which bubbles up to affect the rule
    • livereload cache buster is now treated specially
    • upgrade dependencies
    Source code(tar.gz)
    Source code(zip)
  • v2.0.0(Nov 9, 2014)

    • Fixed multiplication in non strict units mode to take the left operand unit, in the case that the unit cannot be resolved
    • Some fixes for browser cross-compatibility
    • browser tests now pass in IE 8-11 and FF
    • added index.js and browser.js in root as shortcuts
    • fixed some local variable spellings
    • support for @counter-style directive
    Source code(tar.gz)
    Source code(zip)
  • v2.0.0-b3(Nov 1, 2014)

    some refactoring of browser structure to allow use of api vs normal browser bundle browser bundle no longer leaks require browser can now be scoped with just window browser useFileCache defaults to true, but file cache is now cleared when refreshing or in watch mode

    Source code(tar.gz)
    Source code(zip)
  • v2.0.0-b2(Nov 1, 2014)

    Imports are now sequenced and so are consistent (previously some complex projects might end up with occasional different orderings) Imports with variables are better supported - variables can be specified in sub imports Support for rebeccapurple Browser can now accept options as attributes on the script tag and the link tags e.g. <script data-verbose="false" src="less.js"... adding a .less file extension is done in the abstract file manager so it the behaviour can be overridden by certain file managers Fixed a bug where unquoted urls beginning // e.g. url(//file/file.less) would be incorrectly interpreted (bug introduced in b-1) lessc plugins can be a function, used as a constructor as well as an object - this to allow the plugin more flexibility to be used programattically

    Source code(tar.gz)
    Source code(zip)
  • v2.0.0-b1(Nov 1, 2014)

    Public Beta / Release Candidate - Feedback welcome For a guide to breaking changes see the v2 upgrade guide no longer including old versions of less in the repo or npm not including test less and gradle files in npm colours now output in the format they are added, so yellow will output yellow, not its hex counterpart better parsing - better comment support and comments in brackets can now contain comments including quotes. Removal of dependency on clean-css - install less-plugin-clean-css and use --clean-css to reference plugin Environment Support - less is now separate from its node and browser environment implementations and adding support for another javascript environment should be straight forward. Plugin Support - it is now straight forward to add AST manipulations (see less-plugin-inline-images), file managers (see less-plugin-npm-import) and post processors (see less-plugin-clean-css and less-plugin-autoprefix). We now recommend using less.render and using the parser directly is not in the same way as in v2. It is possible but it would require changes and we do not guarantee it will not be broken in minor version releases. In the browser, less.pageLoadFinished will be a promise, resolved when less has finished its initial processing. less.refresh and less.modifyVars also return promises. In the browser, as before less is used as options, however this is now copied to less.options if you need to access after less has run In the browser, the cache can be overwritten by setting less.cache before less loads. After load less.cache will be the default implementation. less.js now uses browserify to generate its browser side component default values for the sourcemap options have been re-done and improved to hopefully mean creating sourcemaps is easier Many smaller bugfixes and API changes. Please let us know if something you relied on has disappeared or an area should be better documented.

    Source code(tar.gz)
    Source code(zip)
  • v1.7.5(Nov 1, 2014)

    Allow comments in keyframe (complete comment support coming in 2.0) pass options to parser from less.render Support /deep/ combinator handle fragments in data-uri's float @charsets to the top correctly updates to some dependencies Fix interpolated import in media query A few other various small corrections

    Source code(tar.gz)
    Source code(zip)
  • v1.7.4(Nov 1, 2014)

    Handle uppercase paths in browser Show error if an empty selector is used in extend Fix property merging in directives Fix ordering of charset and import directives Fix race condition that caused a rules is undefined error sometimes if you had a complex import strategy Better error message for imports missing semi-colons or malformed Do not use util.print to avoid deprecate warnings in node 0.11

    Source code(tar.gz)
    Source code(zip)
  • v1.7.3(Nov 1, 2014)

    Include dist files, missing from 1.7.2 Do not round the results of color functions, like lightness, hue, luma etc. Support cover and contain keywords in background definitions

    Source code(tar.gz)
    Source code(zip)
  • v1.7.2(Nov 1, 2014)

    Allow paths option to be a string (in 1.7.1 less started throwing an exception instead of incorrectly processing the string as an array of chars) Do not round numbers when used with javascript (introduced 1.7.0)

    Source code(tar.gz)
    Source code(zip)
  • v1.7.1(Nov 1, 2014)

    Fix detection of recursive mixins Fix the paths option for later versions of node (0.10+) Fix paths joining bug Fix a number precision issue on some versions of node Fix an IE8 issue with importing css files Fix IE11 detection for xhr requests Modify var works if the last line of a less file is a comment. Better detection of valid hex colour codes Some stability fixes to support a low number of available file handles Support comparing values with different quote types e.g. "test" now === 'test' Give better error messages if accessing a url that returns a non 200 status code Fix the e() function when passed empty string Several minor bug fixes

    Source code(tar.gz)
    Source code(zip)
  • v1.7.0(Nov 1, 2014)

    Add support for rulesets in variables and passed to mixins to allow wrapping Change luma to follow the w3c spec, luma is available as luminance. Contrast still uses luma so you may see differences if your threshold % is close to the existing calculated luma. Upgraded clean css which means the --selectors-merge-mode is now renamed --compatibility Add support for using variables with @keyframes, @namespace, @charset Support property merging with +_ when spaces are needed and keep + for comma separated Imports now always import once consistently - a race condition meant previously certain configurations would lead to a different ordering of files Fix support for .mixin(@args...) when called with no args (e.g. .mixin();) Do unit conversions with min and max functions. Don't pass through if not understood, throw an error Allow % to be passed on its own to the unit function e.g. unit(10, %) Fix a bug when comparing a unit value to a non-unit value if the unit-value was the multiple of another unit (e.g. cm, mm, deg etc.) Fix mixins with media queries in import reference files not being put into the output (they now output, they used to incorrectly not) Fix lint mode - now reports all errors Fixed a small scope issue with & {} selector rulesets incorrectly making mixins visible - regression from 1.6.2 Browser - added log level "debug" at 3 to get less logging, The default has changed so unless you set the value to the default you won't see a difference Browser - logLevel takes effect regardless of the environment (production/dev) Browser - added postProcessor option, a function called to post-process the css before adding to the page Browser - use the right request for file access in IE

    Source code(tar.gz)
    Source code(zip)
  • v1.6.3(Nov 1, 2014)

  • v1.6.2(Nov 1, 2014)

    The Rhino release is fixed! ability to use uppercase colours Fix a nasty bug causing syntax errors when selector interpolation is preceded by a long comment (and some other cases) Fix a major bug with the variable scope in guards on selectors (e.g. not mixins) Fold in & when () { to the current selector rather than duplicating it fix another issue with array prototypes add a url-args option which adds a value to all urls (for cache busting) Round numbers to 8 decimal places - thereby stopping javascript precision errors some improvements to the default() function in more complex scenarios improved missing '{' and '(' detection

    Source code(tar.gz)
    Source code(zip)
  • v1.6.1(Nov 1, 2014)

    support ^ and ^^ shadow dom selectors fix sourcemap selector (used to report end of the element or selector) and directive position (previously not supported) fix parsing empty less files error on (currently) ambiguous guards on multiple css selectors older environments - protect against typeof regex returning function Do not use default keyword use innerHTML in tests, not innerText protect for-in in case Array and Object prototypes have custom fields

    Source code(tar.gz)
    Source code(zip)
  • v1.6.0(Nov 1, 2014)

    Properties can be interpolated, e.g. @{prefix}-property: value; a default function has been added only valid in mixin definitions to determine if no other mixins have been matched Added a plugins option that allows specifying an array of visitors run on the less AST Performance improvements that may result in approx 20-40% speed up Javascript evaluations returning numbers can now be used in calculations/functions fixed issue when adding colours, taking the alpha over 1 and breaking when used in colour functions when adding together 2 colours with non zero alpha, the alpha will now be combined rather than added the advanced colour functions no longer ignore transparency, they blend that too Added --clean-option and cleancssOptions to allow passing in clean css options rgba declarations are now always clamped e.g. rgba(-1,258,258, -1) becomes rgba(0, 255, 255, 0) Fix possible issue with import reference not bringing in styles (may not be a bugfix, just a code tidy) Fix some issues with urls() being prefixed twice and unquoted urls in mixins being processed each time they are called Fixed error messages for undefined variables in javascript evaluation Fixed line/column numbers from math errors

    Source code(tar.gz)
    Source code(zip)
  • v1.5.1(Nov 1, 2014)

    Added source-map-URL option Fixed a bug which meant the minimised 1.5.0 browser version was not wrapped, meaning it interfered with require js Fixed a bug where the browser version assume port was specified Added the ability to specify variables on the command line Upgraded clean-css and fixed it from trying to import correct a bug meaning imports weren't synchronous (syncImport option available for full synchronous behaviour) better mixin matching behaviour with calling multiple classes e.g. .a.b.c;

    Source code(tar.gz)
    Source code(zip)
Automatically convert those LESS file which is not using less function to CSS.

less-2-css Automatically convert those .less file which is not using less function to .css. Why Less is a powerful CSS pre-processor, but it also very

UmiJS 14 May 24, 2022
Dynamic-web-development - Dynamic web development used CSS and HTML

Dynamic-web-development ASSISNMENT I just used CSS and HTML to make a mobile int

null 1 Feb 8, 2022
dynamic-component-app is an angular application for dynamic component template creation

MyApp This project was generated with Angular CLI version 14.1.0. Development server Run ng serve for a dev server. Navigate to http://localhost:4200/

Aniket Muruskar 7 Aug 26, 2022
Dynamic (Per line/paragraph depend on language you type) RTL/LTR support plugin for Obsidian.md

In the name of Allah Obsidian Dynamic RTL Dynamic (Per line/paragraph depending on the language you type) RTL/LTR support plugin for Obsidian.md Previ

Amirreza Aliakbari 33 Jan 2, 2023
Reasonable System for CSS Stylesheet Structure

Viewing this from GitHub? Visit the website for the full experience. rscss.io → rscss Styling CSS without losing your sanity Reasonable System for CSS

Rico Sta. Cruz 3.9k Dec 21, 2022
Fully typed hooks and utility functions for the React Native StyleSheet API

react-native-style-utilities Fully typed hooks and utility functions for the React Native StyleSheet API npm i react-native-style-utilities ESLint Set

Marc Rousavy 73 Dec 17, 2022
Bootstrap-print-css - Print Stylesheet for Bootstrap 5

Bootstrap Print CSS ??️ Bootstrap 5 no longer includes custom CSS for printing - with the CSS in this project you can add it back. Note: This should i

Christian Oliff 35 Dec 13, 2022
This stylesheet customizes Jupyter Notebooks to a dark-theme with vibrant pink, blue, and lime accents.

jupyter-dragonfruit-theme This stylesheet customizes Jupyter Notebooks to a dark-theme with vibrant pink, blue, and lime accents. Author Website Conta

Allen Chang 1 Jan 29, 2022
A typography stylesheet for readable content

yue.css yue.css is a typography stylesheet for readable content. It was created for my blog at first since I always designed a new theme for my blog.

Typlog 481 Dec 22, 2022
Stylesheet and scripts for implementing dark mode with Bootstrap 4

Bootstrap Darkmode This project provides a stylesheet and two scripts that allow you to implement a dark theme on your website. It is initially loaded

Adrian Kunz 41 Nov 27, 2022
CSS-based animations triggered by JS, defined in your stylesheet

Anim-x CSS-based animations triggered by JS, defined in your stylesheet. $ npm i https://github.com/LTBL-Studio/anim-x.git Quick start An animation is

LTBL 2 Sep 29, 2021
A CSS stylesheet to quickly highlight a11y concerns.

Checka11y.css A CSS stylesheet to quickly highlight a11y concerns. Lightweight • Modern • Accessibile • Customisable • Simple The first line of defenc

Jack Domleo 428 Dec 25, 2022
Bootstrap 4 stylesheet that implements vertically-oriented navigation tabs.

Responsive Vertical Navigation Tabs for Boostrap 4 New! ?? If you use Bootstrap 5, a new package is available for that: bootstrap-5-vertical-tabs A st

Tromgy 9 Aug 4, 2022
Pure JavaScript HTML5 Canvas Range Slider. No stylesheet needed. Simple, elegant and powerful. A quirky alternative to other sliders.

CanvasSlider CanvasSlider is a lightweight JavaScript range slider. Most of the range slider controls use Javascript and a stylesheet. This slider use

null 7 Aug 15, 2022
i18n-language.js is Simple i18n language with Vanilla Javascript

i18n-language.js i18n-language.js is Simple i18n language with Vanilla Javascript Write by Hyun SHIN Demo Page: http://i18n-language.s3-website.ap-nor

Shin Hyun 21 Jul 12, 2022
When a person that doesn't know how to create a programming language tries to create a programming language

Kochanowski Online Spróbuj Kochanowskiego bez konfiguracji projektu! https://mmusielik.xyz/projects/kochanowski Instalacja Stwórz nowy projekt przez n

Maciej Musielik 18 Dec 4, 2022
Write "hello world" in your native language, code "hello world" in your favorite programming language!

Hello World, All languages! ?? ?? Write "hello world" in your native language, code "hello world" in your favorite language! #hacktoberfest2022 How to

Carolina Calixto 6 Dec 13, 2022
The Less Formal CSS Framework

PaperCSS The less formal CSS framework, with a quick and easy integration. Table of contents Table of contents Quick-start Status Content of the frame

PaperCSS 3.8k Jan 4, 2023
:necktie: :briefcase: Build fast :rocket: and easy multiple beautiful resumes and create your best CV ever! Made with Vue and LESS.

best-resume-ever ?? ?? Build fast ?? and easy multiple beautiful resumes and create your best CV ever! Made with Vue and LESS. Cool Creative Green Pur

Sara Steiert 15.8k Jan 9, 2023
A dependency-free JavaScript ES6 slider and carousel. It’s lightweight, flexible and fast. Designed to slide. No less, no more

Glide.js is a dependency-free JavaScript ES6 slider and carousel. It’s lightweight, flexible and fast. Designed to slide. No less, no more What can co

null 6.7k Jan 7, 2023