How do I use a variable in less js as a command that appears before a parenthesis?
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 17k
- Forks
- 3.4k
- Avg merge
- 7h 42m
- Merged PRs (30d)
- 26
Description
How do I use a variable in less js as a command that appears before a ( bracket or parenthesis?
I asked on Stack Overflow and couldn't get any help.
.breadcrumb li:nth-child(2) a { background: darken(@breadcrumbrootback, 5%); }
.breadcrumb li:nth-child(2) a:after { border-left-color: darken(@breadcrumbrootback, 5%); }
I would like to change darken( to @breadcrumbcolouraction( so the command is chosen based on a variable (so it could be either lighten or darken based on the value or a variable). How do I do this?
@breadcrumbcolouraction: "darken";
@breadcrumbcolouraction: "lighten";
In less version 4.1.1 if I changed darken to the variable @breadcrumbcolouraction, the less file would fail to compile.
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
The issue names Less 4.1.1 but no repository files or tests. Start by checking the documented handling of variables before parentheses and the relevant Less function-resolution behavior; done means determining whether the requested dynamic lighten/darken selection is supported and documenting or scoping the required change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100