Selecting children by class name
See original GitHub issueHello, I am trying to figure out how to select nested children by class name using this library. Below is an example of how we did it with JSS:
el1: {
'&:hover $el2': {
display: 'block',
},
},
el2: {
display: 'none'
},
Is this currently supported? The docs say:
tss-react unlike jss-react doesn’t support the $ syntax, but you’ll see. It isn’t needed.
But don’t clarify how we would do the above.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:10 (10 by maintainers)
Top Results From Across the Web
How to get child element by class name? - Stack Overflow
Use element.querySelector(). Lets assume: 'myElement' is the parent element you already have. 'sonClassName' is the class of the child you are looking for ......
Read more >Child combinator - CSS: Cascading Style Sheets | MDN
The child combinator ( > ) is placed between two CSS selectors. It matches only those elements matched by the second selector that...
Read more >Get Child Element by Class using JavaScript | bobbyhadz
Use the document.querySelector() method to get the parent element. · Call the querySelector method on the parent element passing it the class name...
Read more >HTML DOM Element getElementsByClassName() - W3Schools
The getElementsByClassName() method returns a collection of child elements with a given class name. The getElementsByClassName() method returns a NodeList ...
Read more >.children() | jQuery API Documentation
children () method allows us to search through the children of these elements in the DOM tree and construct a new jQuery object...
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 have started on the work but have been unable to get it to work properly with typescript typings. The
classes
object keeps coming back asRecord<never, string>
and I am unsure why. See the PR here: https://github.com/garronej/tss-react/pull/13Yes, I think that would be a great alternative to the jss syntax.