The Wayback Machine - https://web.archive.org/web/20201104192313/https://github.com/atomicojs/rollup-plugin-import-css
Skip to content
This repository has been archived by the owner. It is now read-only.
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 
 
 

README.md

@atomico/rollup-plugin-import-css

This plugin allows you to import the css content as a module, to be used inside the <style>{style}</style> tag inside the shadowDom, the css reading is done through postcss so you can include the plugins that you consider convenient for the construction of your css.

The activation of this plugins only happens when the CSS code is required otherwise it will ignore the import.

import style from "style.css"; // sync
import("style.css"); // dinamic

install

yarn add @atomico/rollup-plugin-import-css

usage

import importCss from "@atomico/rollup-plugin-import-css";

options

let options = {
	include: ["**/*.css"],
	explude: [],
	minimize: true, // will add the list of plugins cssnano
	plugins: [],
	/**
	 * this function allows you to manipulate the return of the module
	 * allowing, alter the export to be decorated by
	 * other libraries
	 */
	generate(code) {
		return `export default ${JSON.stringify(code.toString())};`;
	}
};

About

This plugin allows you to import the css content as a module

Topics

Resources

Packages

No packages published
You can’t perform that action at this time.