lit-style-loader

0.0.4 • Public • Published

Lit Style Loader

lit-style-loader

Exports CSS as CSSResult[] for lit-element.

Getting Started

To begin, you'll need to install lit-style-loader:

npm install --save-dev lit-style-loader
yarn add --dev lit-style-loader

It's recommended to combine lit-style-loader with the css-loader

Then add the loader to your webpack config. For example:

component.css

:host {
  background: green;
}

component.js

import styles from "./style.css?lit";
 
export default class extends LitElement {
  static get styles() {
    return styles;
  }
}

webpack.config.js

module.exports = {
  module: {
    rules: [
      {
        test: /\.css$/i,
        oneOf: [
          {
            resourceQuery: /lit/,
            use: ["lit-style-loader", "css-loader"],
          },
          {
            use: ["style-loader", "css-loader"],
          },
        ],
      },
    ],
  },
};

License

MIT

Package Sidebar

Install

npm i lit-style-loader

Weekly Downloads

1

Version

0.0.4

License

MIT

Unpacked Size

5.47 kB

Total Files

5

Last publish

Collaborators

  • opportunity