Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@reboost/plugin-litcss

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@reboost/plugin-litcss

LitCSS plugin for Reboost

  • 0.20.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

npm license

LitCSS Plugin

Easily load stylesheets as LitCSS style modules.

Usage

Setup

Install it using npm

npm i -D @reboost/plugin-litcss

Install lit-element package, if not already installed

npm i lit-element

Import it from the package, also import built-in UsePlugin

const { start, builtInPlugins: { UsePlugin } } = require('reboost');
const LitCSSPlugin = require('@reboost/plugin-litcss');

Add it to the plugins array

const { start, builtInPlugins: { UsePlugin } } = require('reboost');
const LitCSSPlugin = require('@reboost/plugin-litcss');

start({
  plugins: [
    UsePlugin({
      include: '**/*.lit.css',
      use: LitCSSPlugin()
    })
  ]
});

Require file in your code

import style from './file.lit.css';

Example

Basic usage with lit-element

reboost.js

const { start, builtInPlugins: { UsePlugin } } = require('reboost');
const LitCSSPlugin = require('@reboost/plugin-litcss');

start({
  // ...
  plugins: [
    UsePlugin({
      include: '**/*.lit.css',
      use: LitCSSPlugin()
    })
  ]
});

styles.lit.css

.main {
  font-family: sans-serif;
  font-size: x-large;
  background-color: rgb(248, 33, 115);
  color: white;
  padding: 10px;
  display: inline-block;
}

index.js

import { LitElement, customElement, html } from 'lit-element';

import style from './styles.lit.css';

@customElement('my-element')
export class MyElement extends LitElement {
  static get styles() {
    return [style];
  }

  render() {
    return html`
      <span class="main">Lit Element</span>
    `
  }
}

Keywords

FAQs

Package last updated on 25 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc