{"id":14971400,"url":"https://github.com/shellscape/postcss-less","last_synced_at":"2025-05-15T23:08:50.878Z","repository":{"id":44463288,"uuid":"50420098","full_name":"shellscape/postcss-less","owner":"shellscape","description":"PostCSS Syntax for parsing LESS","archived":false,"fork":false,"pushed_at":"2023-07-23T15:03:42.000Z","size":1199,"stargazers_count":124,"open_issues_count":12,"forks_count":39,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-05-07T23:08:37.962Z","etag":null,"topics":["custom-stringifier","less","parse","parser","postcss","postcss-plugin","stylelint","syntax"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shellscape.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/funding.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"patreon":"shellscape","custom":"https://paypal.me/shellscape","liberapay":"shellscape"}},"created_at":"2016-01-26T09:59:51.000Z","updated_at":"2024-11-13T07:31:32.000Z","dependencies_parsed_at":"2024-06-18T12:27:29.777Z","dependency_job_id":"ac7d935d-c1c0-44c2-ba7c-199f32adce9b","html_url":"https://github.com/shellscape/postcss-less","commit_stats":{"total_commits":204,"total_committers":27,"mean_commits":7.555555555555555,"dds":0.7303921568627452,"last_synced_commit":"984f4901aced4b74535d96b04242681d538d628b"},"previous_names":["webschik/postcss-less"],"tags_count":36,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shellscape%2Fpostcss-less","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shellscape%2Fpostcss-less/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shellscape%2Fpostcss-less/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shellscape%2Fpostcss-less/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shellscape","download_url":"https://codeload.github.com/shellscape/postcss-less/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254436949,"owners_count":22070947,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["custom-stringifier","less","parse","parser","postcss","postcss-plugin","stylelint","syntax"],"created_at":"2024-09-24T13:45:08.775Z","updated_at":"2025-05-15T23:08:45.144Z","avatar_url":"https://github.com/shellscape.png","language":"JavaScript","readme":"[tests]: \thttps://img.shields.io/circleci/project/github/shellscape/postcss-less.svg\n[tests-url]: https://circleci.com/gh/shellscape/postcss-less\n\n[cover]: https://codecov.io/gh/shellscape/postcss-less/branch/master/graph/badge.svg\n[cover-url]: https://codecov.io/gh/shellscape/postcss-less\n\n[size]: https://packagephobia.now.sh/badge?p=postcss-less\n[size-url]: https://packagephobia.now.sh/result?p=postcss-less\n\n[PostCSS]: https://github.com/postcss/postcss\n[PostCSS-SCSS]: https://github.com/postcss/postcss-scss\n[LESS]: https://lesscss.org/\n[Autoprefixer]: https://github.com/postcss/autoprefixer\n[Stylelint]: http://stylelint.io/\n\n# postcss-less\n\n[![tests][tests]][tests-url]\n[![cover][cover]][cover-url]\n[![size][size]][size-url]\n\nA [PostCSS] Syntax for parsing [LESS]\n\n_Note: This module requires Node v6.14.4+. `poscss-less` is not a LESS compiler. For compiling LESS, please use the official toolset for LESS._\n\n## Install\n\nUsing npm:\n\n```console\nnpm install postcss-less --save-dev\n```\n\n\u003ca href=\"https://www.patreon.com/shellscape\"\u003e\n  \u003cimg src=\"https://c5.patreon.com/external/logo/become_a_patron_button@2x.png\" width=\"160\"\u003e\n\u003c/a\u003e\n\nPlease consider [becoming a patron](https://www.patreon.com/shellscape) if you find this module useful.\n\n## Usage\n\nThe most common use of `postcss-less` is for applying PostCSS transformations directly to LESS source. eg. ia theme written in LESS which uses [Autoprefixer] to add appropriate vendor prefixes.\n\n```js\nconst syntax = require('postcss-less');\npostcss(plugins)\n  .process(lessText, { syntax: syntax })\n  .then(function (result) {\n    result.content // LESS with transformations\n});\n```\n\n## LESS Specific Parsing\n\n### `@import`\n\nParsing of LESS-specific `@import` statements and options are supported.\n\n```less\n@import (option) 'file.less';\n```\n\nThe AST will contain an `AtRule` node with:\n\n- an `import: true` property\n- a `filename: \u003cString\u003e` property containing the imported filename\n- an `options: \u003cString\u003e` property containing any [import options](http://lesscss.org/features/#import-atrules-feature-import-options) specified\n\n### Inline Comments\n\nParsing of single-line comments in CSS is supported.\n\n```less\n:root {\n    // Main theme color\n    --color: red;\n}\n```\n\nThe AST will contain a `Comment` node with an `inline: true` property.\n\n### Mixins\n\nParsing of LESS mixins is supported.\n\n```less\n.my-mixin {\n  color: black;\n}\n```\n\nThe AST will contain an `AtRule` node with a `mixin: true` property.\n\n#### `!important`\n\nMixins that declare `!important` will contain an `important: true` property on their respective node.\n\n### Variables\n\nParsing of LESS variables is supported.\n\n```less\n@link-color: #428bca;\n```\n\nThe AST will contain an `AtRule` node with a `variable: true` property.\n\n_Note: LESS variables are strictly parsed - a colon (`:`) must immediately follow a variable name._\n\n## Stringifying\n\nTo process LESS code without PostCSS transformations, custom stringifier\nshould be provided.\n\n```js\nconst postcss = require('postcss');\nconst syntax = require('postcss-less');\n\nconst less = `\n    // inline comment\n\n    .container {\n        .mixin-1();\n        .mixin-2;\n        .mixin-3 (@width: 100px) {\n            width: @width;\n        }\n    }\n\n    .rotation(@deg:5deg){\n      .transform(rotate(@deg));\n    }\n`;\n\nconst result = await postcss().process(less, { syntax });\n\n // will contain the value of `less`\nconst { content } = result;\n```\n\n## Use Cases\n\n- Lint LESS code with 3rd-party plugins.\n- Apply PostCSS transformations (such as [Autoprefixer](https://github.com/postcss/autoprefixer)) directly to the LESS source code\n\n## Meta\n\n[CONTRIBUTING](./.github/CONTRIBUTING)\n\n[LICENSE (MIT)](./LICENSE)\n","funding_links":["https://patreon.com/shellscape","https://paypal.me/shellscape","https://liberapay.com/shellscape","https://www.patreon.com/shellscape"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshellscape%2Fpostcss-less","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshellscape%2Fpostcss-less","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshellscape%2Fpostcss-less/lists"}