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.

Selecting children by class name

See original GitHub issue

Hello, 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:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
jsakascommented, Aug 18, 2021

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 as Record<never, string> and I am unsure why. See the PR here: https://github.com/garronej/tss-react/pull/13

1reaction
jsakascommented, Aug 18, 2021

Any though?

Yes, I think that would be a great alternative to the jss syntax.

Read more comments on GitHub >

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

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