Feature request: Property lookup (a.k.a Properties are Variables too)
See original GitHub issueI found a pretty neat feature in Stylus recently, a property lookup which allows you to use properties in the current or closest parent ancestor and use it for calculations.
In Stylus this would look like this:
.test
foo: 200
bar: (@foo/2)
.child
baz: @foo
which produces this CSS:
.test {
foo: 200;
bar: 100;
}
.test .child {
baz: 200;
}
For less we could use the $-sign or maybe brackets to select properties. It then would look something similar to this:
.test {
foo: 200;
bar: $foo / 2;
.child {
baz: $foo;
}
}
or this respectively:
.test {
foo: 200;
bar: [foo] / 2;
.child {
baz: [foo];
}
}
Thoughts on this?
Issue Analytics
- State:
- Created 9 years ago
- Comments:57 (36 by maintainers)
Top Results From Across the Web
Feature Request - Variable linking in string properties
I would like to simply have that configuration's Part Number property read from the current value of the #Length configuration variable. That ...
Read more >CSS Custom Properties for Cascading Variables Module Level 1
This module introduces a family of custom author-defined properties known collectively as custom properties, which allow an author to assign ...
Read more >Property accessors - JavaScript - MDN Web Docs - Mozilla
Property accessors provide access to an object's properties by using ... an associative array (a.k.a. map, dictionary, hash, lookup table).
Read more >Properties vs. Public Variables - Coding Horror
Changing a variable to a property is a breaking change. It's a shame there's so much meaningless friction between variables and properties; most ......
Read more >[GA4] Explore playbook - Analytics Help - Google Support
In Google Analytics 4 properties, the pages report looks different, ... the Metrics section in the Variables pane, and search for the “Views”...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Note that simple property referencing (
$prop
) is implemented, but not documented (AFAIK).This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.