-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
CSS @apply rule leads to parser error #1113
Comments
Can you make a small repo showing what you're seeing? Is your |
|
This is up to the version of svelte-loader being used — it was added in 2.3.0. I'm also curious about whether or not the style function is getting called. FWIW Svelte by itself is fine with |
@ricardobeat Any updates on this? |
Running into a very similar issue.
Using |
I would love to use @apply with svelte components. Has anyone an idea how to fix it? |
Please don't comment on old threads with new issues. Instead consider opening a new issue and add a link back referencing old issues. Or for general support questions you're better off posting your question to https://stackoverflow.com/questions/tagged/svelte. For
|
According to the draft specification (http://tabatkins.github.io/specs/css-apply-rule/), and as supported by postcss-apply, this is the correct syntax for the
@apply
rule:Currently svelte chokes on it with:
Even though there is a comment right above mentioning
@apply
support.The error happens at
svelte/src/css/Stylesheet.ts
Line 296 in a8eaa7e
I'm sending a PR that fixes this by checking for
.children
- though I'm not sure it is the right way to solve it, and I don't understand why svelte is parsing the CSS before applying thestyles
transform; I may be doing something wrong?I'm using sapper and set the preprocessor through
options.style
in the webpack client config:The text was updated successfully, but these errors were encountered: