0.2.1 • Published 3 years ago

inline-css-imports v0.2.1

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

#Inline css @imports

NPM version Build Status

You have a css string with @import statements, you want them resolved and inlined into said css string. Code mostly adapted from the css @import part of inliner. Recursively inlines css imports, so works for nested @imports too.

Still relatively early days, use with caution.

Requirements

Node@^0.12 (could use earlier version if you polyfilled Promise).

Usage

npm install --save inline-css-imports

import inlineCssImports from 'inline-css-imports'

// css -- string || css to inline imports inside
// baseUrl -- string || url where css is hosted - required to resolve relative import paths

inlineCssImports(css, baseUrl)
.then(function (updatedCss) {
  console.log('I have all css @imports inlined!', updatedCss)
})

Note

Will just remove @import for css that doesn't exist.

0.3.0-rc2

3 years ago

0.3.0-rc1

4 years ago

0.2.1

5 years ago

0.2.0

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

9 years ago

0.0.0

9 years ago