Comments (3)
I found it. I'm just using the wrong syntax: https://github.com/callstack/linaria/blob/master/docs/BASICS.md
It needs to be a regular css inside backticks.
After adding the module.exports
and fixing the syntax it now compiles and works.
I'm closing this issue, as I think my problem was in gatsby-config.js
.
Thanks for help!
from gatsby-plugin-linaria.
You're missing module.exports
in your gatsby-config.js
. However, now I'm getting errors like this:
ERROR #98123 WEBPACK
Generating development JavaScript bundle failed
SyntaxError
(5:6) Missed semicolon
3 | import { styled } from 'linaria/react'
4 |
> 5 | const MottoTextStyle = styled.div`
| ^
6 | fontSize: "xx-large",
7 | fontFamily: ["Bai Jamjuree", "sans-serif"],
File: .linaria-cache/src/components/motto.linaria.css
failed Re-building development bundle - 0.070s
For some reason Linaria compiles the styles with commas instead of semicolons:
.ContainerStyle_clz65eb{position:"absolute", top:"50%", left:"50%", marginRight:"-50%", transform:"translate(-50%, -50%)";}
I'll try to figure out why that is happening, let me know if you have any ideas.
from gatsby-plugin-linaria.
Oh, right! 😄 I was staring at those CSS blocks trying to figure it out. I recommend linting them with stylelint, it might help in the future.
from gatsby-plugin-linaria.
Related Issues (20)
- Make CSS Extraction an option. HOT 1
- Setup renovate
- Setup E2E
- Unexpected token 'export' HOT 12
- Breaks Gatsby v3 HOT 1
- Temporary workaround
- Request to set option `cacheDirectory` HOT 2
- TypeError: filename.endsWith is not a function HOT 2
- npm install issue with Gatsby v4.x.x HOT 2
- Unexpected Runtime errors.
- File with extracted CSS styles not link to my output html
- Support for [email protected]? HOT 1
- Dependency Dashboard
- Plugin doesn't work
- Support Linaria v5 and v6
- Doesn't work with core-js v3 HOT 8
- Option to disable SSR? HOT 4
- Using global styles HOT 5
- Why do we need linaria with gatsbyjs? HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gatsby-plugin-linaria.