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.

Extend dynamically generated selectors (summary).

See original GitHub issue

This ticket is to replace (mostly for the sake of clear minimal examples): #1325 #1539 #1597

It includes two distinct sub-features that require internal selector re-parsing:


[1]. Extend interpolated selector:

@var: a;

@{var} {
  color: red;
}

b:extend(a) {}

Expected result:

a, b {
  color: red;
}

[2]. Extend concatenated selector:

a {
  &b {
    color: blue;
  }
}

c:extend(ab) {}

Expected result:

ab, c {
  color: blue;
}

Related but pretty much independent feature of using a variable as an extend argument, i.e. :extend(@{var}), is clearly specified in #1485 and not included here.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Reactions:3
  • Comments:16 (7 by maintainers)

github_iconTop GitHub Comments

5reactions
zxcabscommented, Feb 14, 2017

🆙

1reaction
pcwinterscommented, Dec 9, 2015

I can imagine that this requires fundamental changes to some internals, but it should really be higher priority. 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using dynamic selectors in Optimizely Web
To see the selector ID of any element, navigate to the Editor and click the element. The ID will be displayed in the...
Read more >
Dynamic Selectors - Philip Walton
Summary. All component libraries that use preprocessors should offer the option of dynamic selectors. It allows for a short and simple name for ......
Read more >
SCSS dynamic selectors - Stack Overflow
1. Using a placeholder selector and @extend : @media screen and (max-width: 768px) { %mq-768 { /* ... */ } } .row, .column,...
Read more >
Sass: @extend
Sass's @extend rule solves this. It's written @extend <selector> , and it tells Sass that one selector should inherit the styles of another....
Read more >
Advanced Selector Techniques | Guides | Docs - TestCafe
You can extend the Selector class with custom properties and methods. This is necessary to implement framework-specific API and retrieve DOM element ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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