css-styled
Advanced tools
Comparing version 0.2.4 to 0.2.5
@@ -7,3 +7,3 @@ /* | ||
repository: git+https://github.com/daybrush/css-styled.git | ||
version: 0.2.4 | ||
version: 0.2.5 | ||
*/ | ||
@@ -49,4 +49,4 @@ 'use strict'; | ||
return css.replace(/([^}{\s}][^}{]*){/mg, function (all, selector) { | ||
return utils.splitComma(selector).map(function (subSelector) { | ||
return css.replace(/([^}{\s}][^}{]*|\s*){/mg, function (_, selector) { | ||
return (selector ? utils.splitComma(selector) : [""]).map(function (subSelector) { | ||
if (subSelector.indexOf("@") === 0) { | ||
@@ -53,0 +53,0 @@ return subSelector; |
@@ -7,3 +7,3 @@ /* | ||
repository: git+https://github.com/daybrush/css-styled.git | ||
version: 0.2.4 | ||
version: 0.2.5 | ||
*/ | ||
@@ -47,4 +47,4 @@ import { splitComma } from '@daybrush/utils'; | ||
return css.replace(/([^}{\s}][^}{]*){/mg, function (all, selector) { | ||
return splitComma(selector).map(function (subSelector) { | ||
return css.replace(/([^}{\s}][^}{]*|\s*){/mg, function (_, selector) { | ||
return (selector ? splitComma(selector) : [""]).map(function (subSelector) { | ||
if (subSelector.indexOf("@") === 0) { | ||
@@ -51,0 +51,0 @@ return subSelector; |
@@ -7,3 +7,3 @@ /* | ||
repository: git+https://github.com/daybrush/css-styled.git | ||
version: 0.2.4 | ||
version: 0.2.5 | ||
*/ | ||
@@ -148,4 +148,4 @@ (function (global, factory) { | ||
return css.replace(/([^}{\s}][^}{]*){/mg, function (all, selector) { | ||
return splitComma(selector).map(function (subSelector) { | ||
return css.replace(/([^}{\s}][^}{]*|\s*){/mg, function (_, selector) { | ||
return (selector ? splitComma(selector) : [""]).map(function (subSelector) { | ||
if (subSelector.indexOf("@") === 0) { | ||
@@ -152,0 +152,0 @@ return subSelector; |
@@ -7,5 +7,5 @@ /* | ||
repository: git+https://github.com/daybrush/css-styled.git | ||
version: 0.2.4 | ||
version: 0.2.5 | ||
*/ | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e=e||self).styled=n()}(this,function(){"use strict";var e=function(e){for(var n=5381,t=e.length;t;)n=33*n^e.charCodeAt(--t);return n>>>0},a=['"',"'",'\\"',"\\'"];function c(e,n,t,r){for(var o=t;o<r;++o){var i=n[o].trim();if(i===e)return o;var u=o;if("("===i?u=c(")",n,o+1,r):-1<a.indexOf(i)&&(u=c(i,n,o+1,r)),-1===u)break;o=u}return-1}function f(e){return function(e,n){for(var t=new RegExp("(\\s*"+(n||",")+"\\s*|\\(|\\)|\"|'|\\\\\"|\\\\'|\\s+)","g"),r=e.split(t).filter(Boolean),o=r.length,i=[],u=[],f=0;f<o;++f){var d=r[f].trim(),l=f;if("("===d)l=c(")",r,f+1,o);else{if(")"===d)throw new Error("invalid format");if(-1<a.indexOf(d))l=c(d,r,f+1,o);else if(d===n){u.length&&(i.push(u.join("")),u=[]);continue}}-1===l&&(l=o-1),u.push(r.slice(f,l+1).join("")),f=l}return u.length&&i.push(u.join("")),i}(e,",")}function l(e,n,t,r){var o,i,u=document.createElement("style");return u.setAttribute("type","text/css"),u.setAttribute("data-styled-id",e),t.nonce&&u.setAttribute("nonce",t.nonce),u.innerHTML=(o=e,i=n,t.original?i:i.replace(/([^}{\s}][^}{]*){/gm,function(e,n){return f(n).map(function(e){return 0===e.indexOf("@")?e:-1<e.indexOf(":global")?e.replace(/\:global/g,""):-1<e.indexOf(":host")?""+e.replace(/\:host/g,"."+o):"."+o+" "+e}).join(", ")+"{"})),(r||document.head||document.body).appendChild(u),u}return function(i){var u,f="rCS"+e(i).toString(36),d=0;return{className:f,inject:function(e,n){void 0===n&&(n={});var t,r=function(e){if(e&&e.getRootNode){var n=e.getRootNode();if(11===n.nodeType)return n}}(e),o=0===d;return(r||o)&&(t=l(f,i,n,r)),o&&(u=t),r||++d,{destroy:function(){r?(e.removeChild(t),t=null):(0<d&&--d,0===d&&u&&(u.parentNode.removeChild(u),u=null))}}}}}}); | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e=e||self).styled=n()}(this,function(){"use strict";var e=function(e){for(var n=5381,t=e.length;t;)n=33*n^e.charCodeAt(--t);return n>>>0},a=['"',"'",'\\"',"\\'"];function c(e,n,t,r){for(var o=t;o<r;++o){var i=n[o].trim();if(i===e)return o;var u=o;if("("===i?u=c(")",n,o+1,r):-1<a.indexOf(i)&&(u=c(i,n,o+1,r)),-1===u)break;o=u}return-1}function f(e){return function(e,n){for(var t=new RegExp("(\\s*"+(n||",")+"\\s*|\\(|\\)|\"|'|\\\\\"|\\\\'|\\s+)","g"),r=e.split(t).filter(Boolean),o=r.length,i=[],u=[],f=0;f<o;++f){var d=r[f].trim(),l=f;if("("===d)l=c(")",r,f+1,o);else{if(")"===d)throw new Error("invalid format");if(-1<a.indexOf(d))l=c(d,r,f+1,o);else if(d===n){u.length&&(i.push(u.join("")),u=[]);continue}}-1===l&&(l=o-1),u.push(r.slice(f,l+1).join("")),f=l}return u.length&&i.push(u.join("")),i}(e,",")}function l(e,n,t,r){var o,i,u=document.createElement("style");return u.setAttribute("type","text/css"),u.setAttribute("data-styled-id",e),t.nonce&&u.setAttribute("nonce",t.nonce),u.innerHTML=(o=e,i=n,t.original?i:i.replace(/([^}{\s}][^}{]*|\s*){/gm,function(e,n){return(n?f(n):[""]).map(function(e){return 0===e.indexOf("@")?e:-1<e.indexOf(":global")?e.replace(/\:global/g,""):-1<e.indexOf(":host")?""+e.replace(/\:host/g,"."+o):"."+o+" "+e}).join(", ")+"{"})),(r||document.head||document.body).appendChild(u),u}return function(i){var u,f="rCS"+e(i).toString(36),d=0;return{className:f,inject:function(e,n){void 0===n&&(n={});var t,r=function(e){if(e&&e.getRootNode){var n=e.getRootNode();if(11===n.nodeType)return n}}(e),o=0===d;return(r||o)&&(t=l(f,i,n,r)),o&&(u=t),r||++d,{destroy:function(){r?(e.removeChild(t),t=null):(0<d&&--d,0===d&&u&&(u.parentNode.removeChild(u),u=null))}}}}}}); | ||
//# sourceMappingURL=styled.min.js.map |
{ | ||
"name": "css-styled", | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"description": "This component is a lightweight, simple line style component.", | ||
@@ -5,0 +5,0 @@ "main": "./dist/styled.cjs.js", |
@@ -22,4 +22,4 @@ import stringHash from "string-hash"; | ||
} | ||
return css.replace(/([^}{\s}][^}{]*){/mg, (all, selector) => { | ||
return splitComma(selector).map(subSelector => { | ||
return css.replace(/([^}{\s}][^}{]*|\s*){/mg, (_, selector) => { | ||
return (selector ? splitComma(selector) : [""]).map(subSelector => { | ||
if (subSelector.indexOf("@") === 0) { | ||
@@ -26,0 +26,0 @@ return subSelector; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
51578
694