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.

Parent element's unique class repeating on all the child elements

See original GitHub issue

Describe the bug

Hi As you see the parent’s class gets repeated on its all child elements. Screenshot 2021-09-10 102640 Screenshot 2021-09-10 102704

Reproduction

https://github.com/babakfp/sveltekit-unique-class-repetition

Logs

No response

System Info

System:
    OS: Windows 10 10.0.19043
    CPU: (12) x64 Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz
    Memory: 6.67 GB / 15.84 GB
  Binaries:
    Node: 14.16.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.11 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 7.22.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1023.0), Chromium (93.0.961.38)
    Internet Explorer: 11.0.19041.906


### Severity

annoyance

### Additional Information

### Severity
It won't look good for Sveltekit on v1.0 public release.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
dominikgcommented, Sep 10, 2021

no, the svelte compiler uses css class for scoping, not attributes. vite-plugin-svelte only changes the generated value to be a hash of the filename instead of a hash of the css content.

if you have technical concerns or actual reproducible bugs i’m eager to learn more, but if this is an aesthetic issue i’m afraid thats the way it is.

0reactions
babakfpcommented, Sep 10, 2021

What if I add an attribute instead of a class? This HMR thing going to work then or not? I don’t know how it works but is it possible to use something like data-vite-hmr="FKD*%0ruj"?

@dominikg

Read more comments on GitHub >

github_iconTop Results From Across the Web

Select distinct child elements from repeating parent using XPath
Use the following axis instead of following-sibling, it will search all document starting from the current context: //catalog[not(.
Read more >
Cascade, specificity, and inheritance - Learn web development
Inheritance also needs to be understood in this context — some CSS property values set on parent elements are inherited by their child...
Read more >
nth-child - CSS-Tricks
The :nth-child selector allows you to select one or more elements ... will iterate through all the children of the parent element and...
Read more >
WordPress School: HTML and CSS Parent-Child Relationship
Inheritance: If the styles of a child HTML element are not specified, the element inherits the styles of its parent, the HTML tag,...
Read more >
CSS :has( ) A Parent Selector Now - Matthias Ott
When an element is rendered to the viewport, its parent is already there, including all its beautiful styling. Repainting the parent – and, ......
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