gatsby-plugin-vanilla-extract

4.0.2 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i gatsby-plugin-vanilla-extract

Weekly Downloads

3,294

Version

4.0.2

License

MIT

Unpacked Size

6.32 kB

Total Files

5

Last publish

Collaborators

  • lekoarts
  • moonmeister
  • kylemathews