Skip to content

Commit

Permalink
add a warning
Browse files Browse the repository at this point in the history
  • Loading branch information
romainmenke committed Aug 10, 2023
1 parent 3449081 commit 4ab9beb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions lib/parse-styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ async function resolveImportId(result, stmt, options, state, postcss) {
// and the current statement doesn't have a data url
// we set the conditions to `not all`.
stmt.media = ["not all"]
result.warn(
`Unable to import '${stmt.uri}' from a stylesheet embedded in a data url`,
{
node: stmt.node,
}
)
return
}

Expand Down
4 changes: 3 additions & 1 deletion test/data-url.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ const test = require("ava")
// internal tooling
const checkFixture = require("./helpers/check-fixture")

test("should inline data urls", checkFixture, "data-url")
test("should inline data urls", checkFixture, "data-url", null, null, [
`Unable to import 'foo.css' from a stylesheet embedded in a data url`,
])

0 comments on commit 4ab9beb

Please sign in to comment.