Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
grunt-myless-beta
Advanced tools
grunt-myless is a second development plugin based on grunt-contrib-less and less 1.7.5 . fixed the bug that the grunt-contrib-less can not resolve image path corretly when the less file was imported by another less file. extend less supported functions
grunt-myless is a second development plugin based on grunt-contrib-less and less 1.7.5 . fixed the bug that the grunt-contrib-less can not resolve image path corretly when the less file was imported by another less file. extend less supported functions and enable user to extend less function by create file at project_root_path/myless/functions. extend less grammer to let less support multiline string.
grunt.loadNpmTasks('grunt-myless');
in your Gruntfile.js grunt.initConfig({
...
myless: {
options: {
paths: './'
},
main: {
files: [
{
expand: true,
cwd:'src/',
src: ['**/*.less'],
dest: 'src/',
ext: '.css'
}
]
}
},
...
});
backgbround: svg-cont('width=80px', 'height=80px', <<EOF
<!-- your svg code here -->
EOF) center cente no-repeat;
backgbround: png8-data-uri(svg-to-png('./my-png.png', 'width=80px', 'height=80px', <<EOF
<!-- your svg code here -->
EOF)) center cente no-repeat;
div:before { content: escape-utf8('中文'); }
background-iamge: svg-cont('width=80px', 'height=80px', <<CODE_END
<!-- you svg code here -->
CODE_END);
background-iamge: svg-cont('width=80px', 'height=80px', <<<EOF
<!-- you svg code here -->
EOF);
grunt-myless will crate a folder named myless at the project root path when it run first time. the folder myless has two sub-folder: data, functions。suppose we want to extend to function: fn1 and fn2, and fn1 is a sync function then fn2 is a async function.
first wo need to create two js file at folder functions. the neme of two files were : fn1.js and asy-fn2.js。the prefix asy- means is a async function.
sencod to implements two functions as follow form.
// fn1.js content
module.exports = function(myless, param1, param2){
var sum = parseInt(param1.value, 10) + parseInt(param2.value, 10);
return myless.util.value.toLessNum(sum, 'px');
};
// asy-fn2.js content
module.exports = function(myless, done, param1, param2){
var sum = parseInt(param1.value, 10) + parseInt(param2.value, 10);
setTimeout(function(){
if(sum <= 0){
var err = 'wrong param!';
done(err, null);
}else{
var ret = myless.util.value.toLessNum(sum, 'px');
done(null, ret);
}
}, 1000);
};
third use functions at you less file, for example:
div {
width : fn1(10, 20);
height: fn2(20, 20);
}
FAQs
grunt-myless is a second development plugin based on grunt-contrib-less and less 1.7.5 . fixed the bug that the grunt-contrib-less can not resolve image path corretly when the less file was imported by another less file. extend less supported functions
We found that grunt-myless-beta 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.