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

Using css tempalte tag in solid-start routes/pages results in an error. #35

Open
jfcieslak opened this issue Jun 21, 2024 · 2 comments
Open

Comments

@jfcieslak
Copy link

jfcieslak commented Jun 21, 2024

Using css tempalte tag in solid-start routes/pages causes an error.
Minimum repro example:

import { css } from 'solid-styled'

export default function Page() {
    css`
        .content {
            padding: 2rem;
        }
    `
    return (
        <main>
            <div class="content">This is a plain card</div>
        </main>
    )
}

Error:

Unexpected use of `css`. Make sure that solid-styled's plugin is setup correctly.

Using css template on other components (e.g. ~/components/Component.tsx) works perfectly fine.

Config:

export default defineConfig({
    vite: {
        plugins: [
            solidStyled({
                filter: {
                    include: 'src/**/*.tsx',
                    exclude: 'node_modules/**/*.{ts,js}',
                },
            }) as PluginOption,
        ],
    },
})
@lxsmnsyc
Copy link
Owner

did you have the correct file extension?

@jfcieslak
Copy link
Author

yes, here is a full reproduction.
https://github.com/jfcieslak/solid-styled-issue-35-repro

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

No branches or pull requests

2 participants