Skip to content
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

<meta> tag get svelte- classname when :root selector is defined #4767

Closed
kjj6198 opened this issue May 3, 2020 · 5 comments · Fixed by #6514
Closed

<meta> tag get svelte- classname when :root selector is defined #4767

kjj6198 opened this issue May 3, 2020 · 5 comments · Fixed by #6514
Labels

Comments

@kjj6198
Copy link
Contributor

kjj6198 commented May 3, 2020

Describe the bug

When I used :root selector in a svelte component using <style>, <meta> in <svelte:head /> tag will get a svelte generated classname.
While I can just move :root selector to other place, I'm not sure if it's expected behavior.

<style>
	:root {
		font-size: 14px;
		--color: #aaa;
	}
</style>

<svelte:head>
  <meta property="description" content="hello world" />
</svelte:head>

<p>
	hello world
</p>

To Reproduce

repl

  1. open inspector
  2. check head, you'll find something like <meta property="description" content="hello world" class="svelte-1ibg0co">

Expected behavior

classname should not be rendered into <meta> tag

@kjj6198
Copy link
Contributor Author

kjj6198 commented May 3, 2020

If I'm not mistaken the class will be also applied if no styles are present... Can't confirm from my phone at the moment and will check later.

If I removed :root class would disappear in <meta> though.

@dreitzner
Copy link
Contributor

You are right... 👍
Thank you

@stale
Copy link

stale bot commented Jun 27, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale-bot label Jun 27, 2021
@tanhauhau tanhauhau added the bug label Jun 29, 2021
@stale stale bot removed the stale-bot label Jun 29, 2021
@tanhauhau
Copy link
Member

seems like having :root will add a svelte-hash class to the p element as well

@Conduitry
Copy link
Member

In 3.40.0, tags matched by :root are no longer getting scoping classes added to them. https://svelte.dev/repl/bbbee26646a443358a0a37944da6b743?version=3.40.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants