style-prepend-loader
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

style-prepend-loader

Prepend style files with ts/js configuration objects

A webpack loader to add a parameter to imported style files in Webpack-projects to transform the object to the desired style and prepend it as a collection of variables.

The purpose of this loader is to keep theme variables in TS files and at compile-time provide them to the preprocessor, to keep a single source of truth.

Supports Create React App (Typescript).

Currently supports only Sass variables.

Usage

const theme = {
  headerColor: 'red'
};
export default theme;
import 'style-prepend-loader!./App.scss?theme=theme/theme.ts';

A create-react-app typescript example is also provided in the repository.

Dependents (0)

Package Sidebar

Install

npm i style-prepend-loader

Weekly Downloads

0

Version

0.0.3

License

MIT

Unpacked Size

11.9 kB

Total Files

6

Last publish

Collaborators

  • nvveen