🌜
🌞
resolve-css-import-urls

resolve-css-import-urls

v4.0.0

Turn css @import statements into full urls

npm install resolve-css-import-urls

README

resolve-css-import-urls Build Status js-standard-style

Parse css import statements (@import url(bar.css)) in a string and return the full urls (http://foo.com/bar.css).

Support for the following @import syntax:

@import url("fineprint.css") print;
@import 'custom.css' projection;
@import "custom.css";

TODO: Support the following

@import "common.css" screen, projection;
@import url('landscape.css') screen and (orientation:landscape);
@import url("bluish.css") projection, tv;

Installation

npm i --save resolve-css-import-urls

Usage

const resolveCssImportUrls = require('resolve-css-import-urls')

resolveCssImportUrls('http://example.com/css', 'url(foo.css); lksjhlksjhdf url(../bar.css);')
// => ['http://example.com/css/foo.css', 'http://example.com/bar.css']

resolveCssImportUrls("(foo.css); lksjhlksjhdf") // => []

License

MIT

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Crafted with <3 by John Otander.


This package was initially generated with yeoman and the p generator.

Release Notes

4.0.0
By John Otander • Published on December 8, 2020

Dancing cat with rad glasses

Custom properties now have solid browser support and are being used more frequently on the web. So we've added custom properties support via the postcss-custom-properties plugin.

This is part of a 4.0 (major) release because it's technically breaking, but it will now behave the way most users expect.

Changelog

  • (#308) Custom property support
  • (#306) Removes the request library and replaces with node-fetch

General

License
MIT
Typescript Types
None found
Tree-shakeable
No

Popularity

GitHub Stargazers
2,773
Community Interest
2,992
Number of Forks
214

Maintenance

Commits
11/2110/2203
Last Commit
Open Issues
62
Closed Issues
165
Open Pull Requests
7
Closed Pull Requests
50

Versions

Versions Released
11/2110/2201
Latest Version Released
Dec 8, 2020
Current Tags
latest4.0.0

Dependencies

Dependencies (4)
Dev Dependencies (0)

Contributors

mrmrs
mrmrs
Commits: 156
johno
johno
Commits: 155
jxnblk
jxnblk
Commits: 78
aputinski
aputinski
Commits: 27
lachlanjc
lachlanjc
Commits: 13
kevinwuhoo
kevinwuhoo
Commits: 11
shawnbot
shawnbot
Commits: 5
johman10
johman10
Commits: 4
scott113341
scott113341
Commits: 3
hoffi
hoffi
Commits: 3
sanderteirlynck
sanderteirlynck
Commits: 3
brntbeer
brntbeer
Commits: 2
outsideris
outsideris
Commits: 1
wjx0820
wjx0820
Commits: 1
radnor
radnor
Commits: 1