4.0.2 • Published 4 months ago

gatsby-plugin-vanilla-extract v4.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

gatsby-plugin-vanilla-extract

Gatsby plugin which wraps the vanilla-extract project for easy use in Gatsby.

Setup

npm install gatsby-plugin-vanilla-extract @vanilla-extract/css @vanilla-extract/webpack-plugin

Add to your site's gatsby-config.js.

module.exports = {
  plugins: [`gatsby-plugin-vanilla-extract`],
};

You can also pass any vanilla-extract configuration object to the plugin.

module.exports = {
  plugins: [
    {
      resolve: `gatsby-plugin-vanilla-extract`,
      options: {
        identifiers: `short`,
      },
    },
  ],
};

How to use

See the vanilla-extract website for full documentation.

src/pages/index.tsx:

import * as React from "react";

import { className } from "../styles/index.css.ts";

export default function Index() {
  return <div className={className}>Pizza</div>;
}

src/styles/index.css.ts:

import { style } from "@vanilla-extract/css";

export const className = style({
  background: "red",
});

Example Project

Kick off your project using Gatsby's example project

Useful Links

4.0.2

4 months ago

3.0.1

1 year ago

4.0.1

1 year ago

4.0.0

1 year ago

3.0.0

2 years ago

1.0.6

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago