
Research
/Security News
Toptal’s GitHub Organization Hijacked: 10 Malicious Packages Published
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
rollup-plugin-postcss-lit
Advanced tools
A Rollup plugin to load postcss processed stylesheets in LitElement components
A Rollup plugin to load postcss processed stylesheets in LitElement components
$ npm i -D rollup-plugin-postcss-lit
Add the postcssLit
plugin after postcss
. This wraps postcss exported style strings with LitElement's css
template literal tag so you can import them directly in your components.
// rollup.config.js
import postcss from 'rollup-plugin-postcss';
import postcssLit from 'rollup-plugin-postcss-lit';
export default {
input: 'entry.js',
output: {
// ...
},
plugins: [
postcss({
// ...
}),
postcssLit(),
],
}
Enjoy postcss processed styles in your LitElement components!
import {customElement, LitElement, css} from 'lit-element';
import myStyles from './styles.css';
import otherStyles from './other-styles.scss';
@customElement('my-component')
export class MyComponent extends LitElement {
// Add a single style
static styles = myStyles;
// Or more!
static styles = [myStyles, otherStyles, css`
.foo {
padding: ${...};
}
`];
render() {
// ...
}
}
postcssLit({
// A glob (or array of globs) of files to include.
// By default this corresponds to the default extensions
// handled by postcss ('**/*.{css,sss,pcss}'). Make sure
// to set this if you want to load other extensions
// such as .scss, .less etc.
include: '**/*.{css,scss}',
// A glob (or array of globs) of files to exclude.
// Default: undefined
exclude,
}),
This plugin is meant to be used with rollup-plugin-postcss
.
If you only need to load plain css files in your LitElement components,
consider using rollup-plugin-lit-css
.
This project is licensed under the MIT License, see LICENSE file for details.
FAQs
Rollup plugin to load PostCSSed stylesheets in LitElement components
The npm package rollup-plugin-postcss-lit receives a total of 10,007 weekly downloads. As such, rollup-plugin-postcss-lit popularity was classified as popular.
We found that rollup-plugin-postcss-lit demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Research
/Security News
Socket researchers investigate 4 malicious npm and PyPI packages with 56,000+ downloads that install surveillance malware.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.