Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
postcss-overrides
Advanced tools
Clone of the LESS parser for PostCSS on overrides (semantic-UI extension) files, all props to original author and maintainers
A PostCSS Syntax for parsing LESS
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.
Using npm:
npm install postcss-less --save-dev
Please consider becoming a patron if you find this module useful.
The 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.
const syntax = require('postcss-less');
postcss(plugins)
.process(lessText, { syntax: syntax })
.then(function (result) {
result.content // LESS with transformations
});
@import
Parsing of LESS-specific @import
statements and options are supported.
@import (option) 'file.less';
The AST will contain an AtRule
node with:
import: true
propertyfilename: <String>
property containing the imported filenameoptions: <String>
property containing any import options specifiedParsing of single-line comments in CSS is supported.
:root {
// Main theme color
--color: red;
}
The AST will contain a Comment
node with an inline: true
property.
Parsing of LESS mixins is supported.
.my-mixin {
color: black;
}
The AST will contain an AtRule
node with a mixin: true
property.
!important
Mixins that declare !important
will contain an important: true
property on their respective node.
Parsing of LESS variables is supported.
@link-color: #428bca;
The AST will contain an AtRule
node with a variable: true
property.
Note: LESS variables are strictly parsed - a colon (:
) must immediately follow a variable name.
To process LESS code without PostCSS transformations, custom stringifier should be provided.
const postcss = require('postcss');
const syntax = require('postcss-less');
const less = `
// inline comment
.container {
.mixin-1();
.mixin-2;
.mixin-3 (@width: 100px) {
width: @width;
}
}
.rotation(@deg:5deg){
.transform(rotate(@deg));
}
`;
const result = await postcss().process(less, { syntax });
// will contain the value of `less`
const { content } = result;
FAQs
Clone of the LESS parser for PostCSS on overrides (semantic-UI extension) files, all props to original author and maintainers
The npm package postcss-overrides receives a total of 0 weekly downloads. As such, postcss-overrides popularity was classified as not popular.
We found that postcss-overrides demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.