About Variables / Default Variables
Nobody has claimed this yet.
- Dominant language
- Less
- Stars
- 680
- Forks
- 442
- PR merge metrics
- No merged PRs in 30d
Description
http://lesscss.cn/features/#variables-feature-default-variables
It writes:
We sometimes get requests for default variables - an ability to set a variable only if it is not already set.
This feature is not required because you can easily override a variable by putting the definition afterwards.
For instance:
// library
@base-color: green;
@dark-color: darken(@base-color, 10%);
// use of library
@import "library.less";
@base-color: red;
This works fine because of Lazy Loading - base-color is overridden and dark-color is a dark red.
I don't think the behavior in the example meets the instruction, because the @base-color is already set to green, it shouldn't be reset to red.
So I think the instruction should be:
" We sometimes get requests for default variables - an ability to set a variable only if it is not already set.
This feature is conflicted with 'overriding a variable by putting the definition afterwards', so we couldn't implement the behavior of default variables."
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
Open the variables-feature-default-variables section at lesscss.cn/features/ and compare its explanation with the example in this issue. Update the documentation to state that default variables conflict with overriding a variable later, then verify that the revised wording accurately describes the example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100