I using vanilla javascript + Vite, why styles doesn’t work?
this point I import style of logo component and this is common style.css
@import url("./CORE/Logo/style.scss");
*,
body,
html {
box-sizing: border-box;
margin: 0px;
padding: 0px;
}
and this is section logo component and how this I import my style from common style.css and implemented
import "../../style.css"
export default () =>
`
<main>
<section>
<figcaption class="logo">
<img src="/images/logo.png" alt="logo" />
</figcaption>
</section>
<section>
<p class="name">Test</p>
</section>
</main>`;
2
Answers
CSSStyleSheet
You can import CSS using import assertions, see https://web.dev/articles/css-module-scripts.