Giter VIP home page Giter VIP logo

Comments (3)

erplsf avatar erplsf commented on June 15, 2024 1

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.

silvenon avatar silvenon commented on June 15, 2024

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.

silvenon avatar silvenon commented on June 15, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.