Skip to content

Commit

Permalink
fix(): :root does not work
Browse files Browse the repository at this point in the history
  • Loading branch information
GitOfZGT committed Nov 18, 2021
1 parent 9621ba1 commit 63c0537
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zougt/some-loader-utils",
"version": "1.3.4",
"version": "1.3.5",
"description": "implementation for less-loader or sass-loader. Compiles Less or sass to CSS.",
"license": "MIT",
"repository": "GitOfZGT/some-loader-utils",
Expand Down
3 changes: 3 additions & 0 deletions src/postcss-addScopeName.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ export default (
) => {
const { allStyleVarFiles } = opts;
function addScopeName(selector, scopeName) {
if (/^:root/i.test(selector)) {
return `.${scopeName}${selector}`;
}
if (/^html/i.test(selector)) {
return selector.replace(
/^html[^\s]*(?=\s*)/gi,
Expand Down

0 comments on commit 63c0537

Please sign in to comment.