add globalVars usage examples
Open
Nobody has claimed this yet.
- Dominant language
- Less
- Stars
- 680
- Forks
- 442
- PR merge metrics
- No merged PRs in 30d
Description
would be nice to clarify that this example
less.globalVars = { myvar: "#ddffee", mystr: "\"quoted\"" };
if for browser only
for Node.JS should be used this code:
var less = require('less');
less.render('.class { width: @width }', {globalVars: {width: 20}}, function (e, css) {
console.log(css);
});
on in some more advanced cases:
var less = require('less'),
parser = new(less.Parser)({
// some options
});
parser.parse('.class { width: @width }', function (e, tree) {
console.log(tree.toCSS({
// some options
}));
}, {globalVars: {width: 20}});
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the documentation section containing the existing globalVars example and compare it with the browser, Node.js, and parser examples in this issue. Update that section to distinguish the usage contexts and include the relevant examples. Done means readers can tell which globalVars form applies to each context.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100