Make @extend available for nested selectors
See original GitHub issueHi,
currently if you try to extend a class, for example #content input
it will throw a error like: “Syntax error: Can’t extend #content input: can’t extend nested selectors”.
It would be great if that would be available!
Issue Analytics
- State:
- Created 9 years ago
- Comments:6
Top Results From Across the Web
css - Extend function doesn't work with nested selectors
When using extend feature to extend nested selectors, an exactly matching selector (full selector path) should be provided (or) the all keyword ...
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 >CSS Nesting Module - W3C
This module introduces the ability to nest one style rule inside another, with the selector of the child rule relative to the selector...
Read more >LESS - Extending Nested Selectors - Tutorialspoint
Nested selectors are matched using the extend selector. Example. The following example demonstrates the use of extending nested selectors in the LESS file...
Read more >Grouping and Nesting CSS Selectors: CSS Tutorial - Sabe.io
It's that simple. To nest a selector, you simply separate them with a space. But what if you had a third paragraph tag...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
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
I think the best way to fix the problem your having is by using a placeholder like this:
I think extending nested selectors would get confusing easily. By using a placeholder it also makes it available if you ever want to use it again without having to remember that the styles you want to use are in
#content input
See these issues for explanations: #609 and #251.
@dustindowell22 nailed this. The rationale is that if you need to extend a modified thing, that thing is worth naming and extracting to it’s own concept.