linaria icon indicating copy to clipboard operation
linaria copied to clipboard

Any idea on the steps to install Linaria in a SvelteKit project

Open nicolasdao opened this issue 3 years ago • 3 comments

Environment

  • SvelteKit: 1.0.0-next.516
  • Linaria version: ^4.1.3
  • Bundler (+ version): vite ^3.1.0
  • Node.js version: 16.14.0
  • OS: MacOS

Description

Have no clue how to install Linaria on SvelteKit. I tried the https://github.com/denn1s/vite-plugin-linaria plugin but it did not work.

nicolasdao avatar Oct 15 '22 11:10 nicolasdao

It is a similar problem with #1068: we have to process .svelte and .vue files before they will be processed by Svelte or Vue. To achieve that, we have to teach Babel to understand the syntax of that files, if it's even possible. Maybe there is another way that can allow preprocessing script section, but since I'm unfamiliar with Vue and Svelte builders, I need some time for investigation or help from the community :)

Anber avatar Oct 25 '22 09:10 Anber

I dont know if this info helps, but there is a sample in https://github.com/madhavarshney/svelte-linaria-sample that I tested, and it work somehow with "linaria": "^1.3.3" and "linaria": "^2.3.1" (not namespaced one, webpack 5 + linaria/loader + svelte).

The sample uses Linaria in svelte files:

<script>
  import { css } from 'linaria';
  const localStyle = css`
    color: green;
  `;
</script>

But when I changed to the namespace ones (@linaria/*), stop working.

jaikme avatar May 03 '23 19:05 jaikme

Any updates?

RuslanGlaznyov avatar Jan 18 '24 14:01 RuslanGlaznyov