rollup-plugin-lit-tailwindcss

2.1.0 • Public • Published

rollup-plugin-lit-tailwindcss

import litTailwind from 'rollup-plugin-lit-tailwindcss';

export default {
  input: 'src/index.ts',
  output: {
    dir: 'dist',
  },
  plugins: [
    litTailwind({
      include: 'src/components/**/*.ts',
      placeholder: 'tw_placeholder',
      placeholder: undefined,
    }),
  ],
};

Then in lit component file:

import { html, css, LitElement } from 'lit';
import { customElement } from 'lit/decorators.js';

@customElement('simple-footer')
export class SimpleComponent extends LitElement {
  static styles = css`tw_placeholder`; // 👈 classes will be injected here

  render() {
    return html`<h1
      class="text-purple-400 md:text-red-400 md:hover:text-green-500"
    >
      Hello, world!
    </h1>`;
  }
}

Todo

  • is this performant???
  • read tailwind config, styles.css?
  • ...

Package Sidebar

Install

npm i rollup-plugin-lit-tailwindcss

Weekly Downloads

0

Version

2.1.0

License

MIT

Unpacked Size

1.96 kB

Total Files

2

Last publish

Collaborators

  • mcha