question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature request: Property lookup (a.k.a Properties are Variables too)

See original GitHub issue

I 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:closed
  • Created 9 years ago
  • Comments:57 (36 by maintainers)

github_iconTop GitHub Comments

3reactions
matthew-deancommented, Nov 28, 2017

Note that simple property referencing ($prop) is implemented, but not documented (AFAIK).

0reactions
stale[bot]commented, Nov 14, 2017

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found