-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
scoping class is incorrectly added to element #7990
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This is a bug in Svelte rather than SvelteKit — it's visible in this reproduction: https://svelte.dev/repl/e14ddc6557ac4352b86fbbe574bcc843?version=3.52.0 The scoping class shouldn't be added to the It's very weird that it's working differently for the Until we get to the bottom of this, there's a workaround: -tbody tr:hover th {
+tbody tr:hover :is(th) { |
Workaround is perfectly fine for me right now. |
There is definitely something up with css scoping. See #7991 |
Fixed in Svelte 5 |
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
Unlike
npm run dev
(gonna call it "dev" from now on),npm run build
(call it "build") does not seem to generate all HTML classes required for styling.When comparing the markup generated, build does omit many classes - probably because it has other rules for checking if a class is needed than dev? Anyway: in most cases that seems to be okay. In some, it leads to broken styles.
Reproduction
A simple table with some CSS:
Note that the table body contains both
th
andtd
.npm run dev
Dev adds a class to the
tr
, but only adds it to one of the child elements:th
. This looks fine, but is already inconsistent. Screenshotnpm run build
Build does not add a class to the
tr
and shows the same inconsistent behaviour with the child elements. The missing class makes this look broken: on hover, the first cell (th
) does not change background. Screenshotnpm run build without thead
Removing the
thead
from the table,npm run build
, will leave out generated classes from both the HTML and CSS. This looks fine and is probably what the compiler output should be. Screenshot(I would have linked Stackblitz but this bug applies to
npm run build
only and notyarn dev
. Sorry, if there's a way to simulate this online and I missed it.)Logs
No response
System Info
Severity
serious, but I can work around it
Additional Information
No response
The text was updated successfully, but these errors were encountered: