4.0.2 • Published 12 months ago

gatsby-plugin-linaria v4.0.2

Weekly downloads
652
License
MIT
Repository
github
Last release
12 months ago

gatsby-plugin-linaria

npm npm downloads

Gatsby plugin for styling with Linaria

Install

Install the plugin and Linaria:

yarn add gatsby-plugin-linaria linaria

Next, add the plugin to gatsby-config.js:

plugins: [
  'gatsby-plugin-linaria',
]

Finally, make sure to add .linaria-cache to your .gitignore file.

TypeScript

If you're using TypeScript, make sure to include gatsby-plugin-typescript before gatsby-plugin-linaria in your config:

plugins: [
  'gatsby-plugin-typescript',
  'gatsby-plugin-linaria',
]

See #13 for more details.

Critical CSS Extraction

GatsbyJS & Linaria extract your stylesheet and inject into the <head> by default. So, you don't need to worry about the SSR & FOUC.

However, the extracted stylesheet would be huge for large site, because it includes css used by whole pages/components

This plugin provide an option extractCritical that use linaria/server API behind the scene

{
  resolve: 'gatsby-plugin-linaria',
  options: {
    extractCritical: true, // false by default.
  },
}

When you opt-in this feature, only Critical CSS is injected into the <head>.

And loading full CSS will be deferred for later paint or navigations.

See this for more detailed explanation.

LICENSE

MIT


Happy styling! :art:

4.0.2

12 months ago

4.0.1

1 year ago

4.0.0-alpha.3

2 years ago

4.0.0-alpha.4

2 years ago

4.0.0-alpha.1

2 years ago

4.0.0-alpha.2

2 years ago

4.0.0-alpha.0

2 years ago

4.0.0

2 years ago

3.2.0

2 years ago

3.1.0

3 years ago

3.1.0-pre.0

3 years ago

3.0.0

3 years ago

2.3.0

3 years ago

2.2.2

3 years ago

2.2.1

3 years ago

2.2.0

4 years ago

2.1.0

4 years ago

2.0.0

4 years ago

1.3.0

4 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.2

5 years ago

1.0.1

6 years ago

1.0.0

6 years ago