framework-utils
Advanced tools
Comparing version 0.3.3 to 0.3.4
@@ -7,3 +7,3 @@ /* | ||
repository: git+https://github.com/daybrush/framework-utils.git | ||
version: 0.3.3 | ||
version: 0.3.4 | ||
*/ | ||
@@ -26,3 +26,5 @@ 'use strict'; | ||
function prefixCSS(prefix, css) { | ||
return css.replace(/\.([^{,\s\d.]+)/g, "." + prefix + "$1"); | ||
return css.replace(/([^}{]*){/mg, function (_, selector) { | ||
return selector.replace(/\.([^{,\s\d.]+)/g, "." + prefix + "$1") + "{"; | ||
}); | ||
} | ||
@@ -29,0 +31,0 @@ /* react */ |
@@ -7,3 +7,3 @@ /* | ||
repository: git+https://github.com/daybrush/framework-utils.git | ||
version: 0.3.3 | ||
version: 0.3.4 | ||
*/ | ||
@@ -24,3 +24,5 @@ function prefixNames(prefix) { | ||
function prefixCSS(prefix, css) { | ||
return css.replace(/\.([^{,\s\d.]+)/g, "." + prefix + "$1"); | ||
return css.replace(/([^}{]*){/mg, function (_, selector) { | ||
return selector.replace(/\.([^{,\s\d.]+)/g, "." + prefix + "$1") + "{"; | ||
}); | ||
} | ||
@@ -27,0 +29,0 @@ /* react */ |
{ | ||
"name": "framework-utils", | ||
"version": "0.3.3", | ||
"version": "0.3.4", | ||
"description": "utils for framework", | ||
@@ -5,0 +5,0 @@ "main": "./dist/utils.cjs.js", |
@@ -8,3 +8,5 @@ export function prefixNames(prefix: string, ...classNames: string[]) { | ||
export function prefixCSS(prefix: string, css: string) { | ||
return css.replace(/\.([^{,\s\d.]+)/g, `.${prefix}$1`); | ||
return css.replace(/([^}{]*){/mg, (_, selector) => { | ||
return `${selector.replace(/\.([^{,\s\d.]+)/g, `.${prefix}$1`)}{`; | ||
}); | ||
} | ||
@@ -11,0 +13,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24870
375