New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

stylis

Package Overview
Dependencies
Maintainers
1
Versions
175
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stylis - npm Package Compare versions

Comparing version 0.12.0 to 1.0.0

8

CHANGELOG.md

@@ -0,1 +1,9 @@

## 1.0.0 (January 27, 2016)
- improve parsing and namespacing animations names in the `animation:` property
- avoid parsing for animation name when animation namespacing is disabled
- performance improvements
- support adding middleware/plugins with objects via `stylis.use`
- add IE 8 support
## 0.12.0 (January 25, 2016)

@@ -2,0 +10,0 @@

12

package.json
{
"name": "stylis",
"main": "stylis.js",
"description": "stylis is a small css compiler",
"version": "0.12.0",
"description": "stylis is a feature-rich css preprocessor",
"version": "1.0.0",
"homepage": "https://github.com/thysultan/stylis.js",

@@ -13,9 +13,9 @@ "license": "MIT",

"keywords": [
"preprocessor",
"parser",
"compiler",
"prefixer",
"css",
"style",
"css namespacing",
"node",
"browser",
"prefix"
"browser"
],

@@ -22,0 +22,0 @@ "repository": {

@@ -5,3 +5,3 @@ # Stylis

- ~2Kb minified+gzipped
- ~3Kb minified+gzipped

@@ -11,7 +11,7 @@ ## Supports

* Edge
* IE 9+
* IE 8+
* Chrome
* Firefox
* Safari
* Node.js
* Node

@@ -32,3 +32,3 @@ ---

```html
<script src=https://unpkg.com/stylis@0.12.0/stylis.min.js></script>
<script src=https://unpkg.com/stylis@1.0.0/stylis.min.js></script>
```

@@ -44,4 +44,5 @@

- variables via `~~foo` and `var(~~foo)`
- variables via `~~foo` and `var(~~foo)` similar to css variables `--foo` and `var(--foo)`
- web component emulation of `:host`, `:host()` and `:host-context()`
- namespacing
- inline global injection via `:global(selector)`

@@ -51,12 +52,10 @@ - block level global injection via `@global {}`

- static and function mixins via `@mixin ...` and `@include`
- prefixer
- namespacing
- prefixer (flex-box, etc...)
- flat css `color: red; h1 { color: red; }`
- middleware support
- keyframes and animation namespacing (with the option to disable)
- including an option to disable compact features like variables and mixins.
- keyframes and animation namespacing
---
Stylis is a small css compiler that turns this
stylis is a feature-rich css preprocessor that turns this

@@ -70,3 +69,2 @@ ```javascript

```scss
// variables

@@ -304,2 +302,7 @@ ~~foo: 20px;

);
stylis.use(
key/middleware: {(string|RegExp|function|array|object)}
plugin: {function=}
)
```

@@ -359,3 +362,2 @@

## Intergration

@@ -362,0 +364,0 @@

@@ -9,3 +9,3 @@ /*

*
* stylis is a small css compiler
* stylis is a feature-rich css preprocessor
*

@@ -25,2 +25,4 @@ * @licence MIT

}(function (window) {
'use strict';

@@ -75,4 +77,13 @@

var animns;
// animation and keyframe namespace
var animns = (animations === void 0 || animations === true) ? namespace : '';
if (animations == void 0 || animations === true) {
animations = true;
animns = namespace;
}
else {
animns = '';
animations = false;
}

@@ -89,5 +100,3 @@ // uses middleware

if (uses === 111) {
for (var i = 0, keys = Object.keys(middleware), length = keys.length; i < length; i++) {
stylis.use(keys[i], middleware[keys[i]]);
}
stylis.use(middleware, null);
}

@@ -180,3 +189,3 @@ // f, not a single function middleware

if (strings === 0 && (code === 123 || code === 125 || code === 59)) {
buff += styles[caret];
buff += styles.charAt(caret);

@@ -295,3 +304,3 @@ var first = buff.charCodeAt(0);

// build content of nested block
inner += styles[caret++];
inner += styles.charAt(caret++);
}

@@ -436,3 +445,3 @@

// - short hand animation syntax
if ((buff.charCodeAt(9) || 0) !== 45) {
if (animations === true && (buff.charCodeAt(9) || 0) !== 45) {
// because we can have multiple animations `animation: slide 4s, slideOut 2s`

@@ -453,4 +462,4 @@ for (var j = 0, length = anims.length; j < length; j++) {

if (
// cubic-bezier()
!(frst === 99 && last === 41) &&
// cubic-bezier()/steps(), )
last !== 41 && len !== 0 &&

@@ -463,4 +472,4 @@ // infinite, i, f, e

// alternate, a, t, e
!(frst === 97 && third === 116 && last === 101 && len === 9) &&
// alternate/alternate-reverse, a, t, e
!(frst === 97 && third === 116 && last === 101 && (len === 9 || len === 17)) &&

@@ -470,3 +479,3 @@ // normal, n, r, l

// backwords, b, c, s
// backwards, b, c, s
!(frst === 98 && third === 99 && last === 115 && len === 9) &&

@@ -483,17 +492,37 @@

// ease, e, s, e
!(frst === 101 && third === 115 && last === 101 && len === 4) &&
// running, r, n, g
!(frst === 114 && third === 110 && last === 103 && len === 7) &&
// ease-
!(frst === 101 && len > 4 && prop.charCodeAt(4) === 45) &&
// paused, p, u, d
!(frst === 112 && third === 117 && last === 100 && len === 6) &&
// durations 0.4ms, .4s, 400ms ...
isNaN(parseFloat(prop))
// reversed, r, v, d
!(frst === 114 && third === 118 && last === 100 && len === 8) &&
// step-start/step-end, s, e, (t/d)
!(
frst === 115 && third === 101 &&
((last === 116 && len === 10) || (last === 100 && len === 8))
) &&
// ease/ease-in/ease-out/ease-in-out, e, s, e
!(
frst === 101 && third === 115 &&
(
(last === 101 && len === 4) ||
(len === 11 || len === 7 || len === 8) && prop.charCodeAt(4) === 45
)
) &&
// durations, 0.4ms, .4s, 400ms ...
isNaN(parseFloat(prop)) &&
// handle spaces in cubic-bezier()/steps() functions
prop.indexOf('(') === -1
) {
props[k] = animns+prop;
anim = props.join(' ');
props[k] = animns + prop;
}
}
build += (j === 0 ? '' : ',') + anim.trim();
build += (j === 0 ? '' : ',') + props.join(' ').trim();
}

@@ -648,3 +677,3 @@ }

// build content of nested block
inner += styles[caret++];
inner += styles.charAt(caret++);
}

@@ -959,3 +988,3 @@

// build line buffer
buff += styles[caret];
buff += styles.charAt(caret);
}

@@ -1025,27 +1054,35 @@ }

// array of plugins
if (plugin instanceof Array) {
for (var i = 0, length = plugin.length; i < length; i++) {
plugins[length++] = plugin[i];
if (plugin != null) {
// object of plugins
if (plugin.constructor === Object) {
for (var name in plugin) {
this.use(name, plugin[name]);
}
}
}
// single un-keyed plugin
else if (key == null) {
plugins[length] = plugin;
}
// keyed plugin
else {
var pattern = (key instanceof RegExp) ? key : new RegExp(key + '\\([ \\t\\r\\n]*([^\\0]*?)[ \\t\\r\\n]*\\)', 'g');
var regex = /[ \t\r\n]*,[ \t\r\n]*/g;
// array of plugins
else if (plugin.constructor === Array) {
for (var i = 0, length = plugin.length; i < length; i++) {
plugins[length++] = plugin[i];
}
}
// single un-keyed plugin
else if (key == null) {
plugins[length] = plugin;
}
// keyed plugin
else {
var pattern = (key instanceof RegExp) ? key : new RegExp(key + '\\([ \\t\\r\\n]*([^\\0]*?)[ \\t\\r\\n]*\\)', 'g');
var regex = /[ \t\r\n]*,[ \t\r\n]*/g;
plugins[length] = function (ctx, str, line, col) {
if (ctx === 6) {
str = str.replace(pattern, function (match, group) {
var args = group.replace(regex, ',').split(',');
var replace = plugin.apply(null, args);
plugins[length] = function (ctx, str, line, col) {
if (ctx === 6) {
str = str.replace(pattern, function (match, group) {
var args = group.replace(regex, ',').split(',');
var replace = plugin.apply(null, args);
return replace != null ? replace : match;
});
return replace != null ? replace : match;
});
return str;
return str;
}
}

@@ -1052,0 +1089,0 @@ }

@@ -1,1 +0,1 @@

!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(global):"function"==typeof define&&define.amd?define(e(window)):window.stylis=e(window)}(function(e){"use strict";function r(e,t,i,l,n){e+="";var s="",a="",f=e.charCodeAt(0)||0;if(91===f){var g=e.substring(1,e.length-1).split("="),o=(a=g[1]).charCodeAt(0);34!==o&&39!==o||(a=a.substring(1,a.length-1)),s="["+g[0]+'="'+a+'"]'}else a=35===f||46===f||62===f?(s=e).substring(1):s=e;f=0;var u,h=void 0===i||i===!0?a:"",c=null!=n;if(c){var d=(typeof n).charCodeAt(0);if(111===d)for(var p=0,b=Object.keys(n),v=b.length;p<v;p++)r.use(b[p],n[b[p]]);else 102!==d&&(c=!1)}0!==(u=r.plugins).length&&(n=function(e,r,t,i){for(var l=r,n=0,s=u.length;n<s;n++)l=u[n](e,l,t,i)||l;return l!==r?l:void 0},c=!0);var m,x,A,C,y,w,O,k,j,E,R,N="",z="",F="",q="",B="",D=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,P="-moz-",Q="-ms-",S="-webkit-";c&&(w=n(0,t,W,V),null!=w&&(t=w));for(var T=0,U=0,V=0,W=1,X=t.length,Y="";T<X;){var Z=t.charCodeAt(T);if(0!==J||123!==Z&&125!==Z&&59!==Z)13===Z||10===Z?(2===I&&(N="",I=0),V=0,W++):9!==Z&&(34===Z?J=34===J?0:39===J?39:34:39===Z?J=39===J?0:34===J?34:39:47===Z&&47===Z&&I<2&&I++,N+=t[T]);else{N+=t[T];var $=N.charCodeAt(0);32===$&&($=(N=N.trim()).charCodeAt(0));var _=N.charCodeAt(1)||0,ee=N.charCodeAt(2)||0;if(c&&125!==Z&&(w=123===Z?n(1,N.substring(0,N.length-1).trim(),W,V):n(2,N,W,V),null!=w&&(N=123===Z?w+"{":w)),2===I)125===Z&&(I=0),N="";else if(64===$){if(1===L&&0!==B.length&&(L=0,B=s+" {"+B+"}",c&&(w=n(4,B,W,V),null!=w&&(B=w)),Y+=B,B=""),107===_||103===_)107===_?(z=N.substring(1,11)+h+N.substring(11),N="@"+S+z,f=1):N="";else if(109===_)if(l===!0&&105===ee)void 0===E&&(E={}),z=(R=N.substring(7,N.indexOf("{"))+" ").trim(),R=R.substring(0,R.indexOf(" ")).trim(),E[R]={key:z.trim(),body:""},f=3,N="",z="";else if(101===ee)if(0!==U){for(T++,y="",x="",A=O.split(","),H=1;T<X&&(o=t.charCodeAt(T),123===o?H++:125===o&&H--,0!==H);)x+=t[T++];for(var p=0,v=A.length;p<v;p++)e=A[p],y+=r((p===v-1?e.substring(0,e.length-1):e).trim(),x,i,l,n);y=N+y+"}",N="",f=4}else f=2;else f=6;if(105===_){if(l===!0&&110===ee)if(N=N.substring(9,N.length-1),k=N.indexOf("("),k>-1){var re=N.substring(0,k),te=E[re],ie=N.substring(re.length+1,N.length-1).split(","),le=te.key.replace(re,"").replace(/\(|\)/g,"").trim().split(",");N=te.body;for(var p=0,v=ie.length;p<v;p++){var ne=le[p].trim();void 0!==ne&&(N=N.replace(new RegExp("var\\(~~"+ne+"\\)","g"),ie[p].trim()))}t+=N,X+=N.length,N=""}else N=E[N].body,0===U&&(t+=N,X+=N.length,N="");else if(109===ee&&c){var se=/@import.*?(["'`][^\.\n\r]*?["'`];|["'`][^:\r\n]*?\.[^c].*?["'`])/g.exec(N);null!==se&&(N=n(5,se[1].replace(/['"; ]/g,""),W,V)||"",N&&(t=t.substring(0,T+1)+N+t.substring(T+1),X+=N.length),N="")}}else 4!==f&&(G=-1,D++)}else if(l===!0&&59===Z&&126===$&&126===_)m=N.indexOf(":"),void 0===j&&(j=[]),j[j.length]=[N.substring(0,m),N.substring(m+1,N.length-1).trim()],N="";else{if(97===$&&110===_&&105===ee){N=N.substring(0,N.length-1),m=N.indexOf(":")+1,C=N.substring(0,m);var ae=N.substring(m).trim().split(",");if(45!==(N.charCodeAt(9)||0))for(var fe=0,v=ae.length;fe<v;fe++){for(var ge=ae[fe],oe=ge.split(" "),ue=0,he=oe.length;ue<he;ue++){var ce=oe[ue].trim(),de=ce.charCodeAt(0),ee=ce.charCodeAt(2),pe=ce.length,be=ce.charCodeAt(pe-1);99===de&&41===be||105===de&&102===ee&&101===be&&8===pe||108===de&&110===ee&&114===be&&6===pe||97===de&&116===ee&&101===be&&9===pe||110===de&&114===ee&&108===be&&6===pe||98===de&&99===ee&&115===be&&9===pe||102===de&&114===ee&&115===be&&8===pe||98===de&&116===ee&&104===be&&4===pe||110===de&&110===ee&&101===be&&4===pe||101===de&&115===ee&&101===be&&4===pe||101===de&&pe>4&&45===ce.charCodeAt(4)||!isNaN(parseFloat(ce))||(oe[ue]=h+ce,ge=oe.join(" "))}C+=(0===fe?"":",")+ge.trim()}else C+=(110!==(N.charCodeAt(10)||0)?"":h)+ae[0].trim();N=S+C+";"+C+";"}else if(97===$&&112===_&&112===ee)N=S+N+P+N+N;else if(100===$&&105===_&&115===ee)N.indexOf("flex")>-1&&(N="display:"+S+"box;display:"+S+"flex;"+Q+"flexbox;display:flex;");else if(116===$&&114===_&&97===ee)N=S+N+(102===N.charCodeAt(5)?Q+N:"")+N;else if(104===$&&121===_&&112===ee||117===$&&115===_&&101===ee)N=S+N+P+N+Q+N+N;else if(102===$&&108===_&&101===ee)N=S+N+Q+N+N;else if(111===$&&114===_&&100===ee)N=S+N+Q+"flex-"+N+N;else if(97===$&&108===_&&105===ee&&45===(N.charCodeAt(5)||0))switch(N.charCodeAt(6)||0){case 105:w=N.replace("-items",""),N=S+"box-"+w+Q+"flex-"+w+N;break;case 115:N=Q+"flex-item-"+N.replace("-self","")+N;break;default:N=Q+"flex-line-pack"+N.replace("align-content","")+N}else if(123===Z){if(U++,1===L&&0!==B.length&&(L=0,B=s+" {"+B+"}",c&&(w=n(4,B,W,V),null!=w&&(B=w)),Y+=B,B=""),0===D||2===f)if(2===U){T++,x="";var ve=N.substring(0,N.length-1).split(","),me=O.substring(0,O.length-1).split(",");for(H=1;T<X&&(o=t.charCodeAt(T),123===o?H++:125===o&&H--,0!==H);)x+=t[T++];for(var fe=0,v=me.length;fe<v;fe++){w=me[fe],me[fe]="";for(var ue=0,he=ve.length;ue<he;ue++)e=w.replace(s,"").trim(),e=ve[ue].indexOf(" &")>0?ve[ue].replace("&","").trim()+" "+e:e+" "+ve[ue].trim(),me[fe]+=e.trim()+(ue===he-1?"":",")}N="\n"+me.join(",")+" {"+x+"}",q+=N.replace(/&| +&/g,""),K=1,N="",U--}else{A=N.split(","),C="";for(var fe=0,v=A.length;fe<v;fe++){var xe=(e=A[fe]).charCodeAt(0);if(32===xe&&(xe=(e=e.trim()).charCodeAt(0)),91===xe)for(var ue=fe+1,he=v-fe;ue<he;ue++){var Ae=(e+=","+A[ue]).trim();if(93===Ae.charCodeAt(Ae.length-1)){v-=ue,A.splice(fe,ue);break}}if(38===xe)e=s+e.substring(1);else if((k=e.indexOf(" &"))>0&&(xe=58,e=":global("+e.substring(0,k)+")"+e.substring(k)),58===xe){var Ce=e.charCodeAt(1);if(104===Ce&&116===e.charCodeAt(4)){var ye=(e=e.substring(5)).charCodeAt(0);40===ye?e=s+e.substring(1).replace(")",""):45===ye?(k=e.indexOf(")"),e=e.substring(9,k)+" "+s+e.substring(k+1)):e=s+e}else e=103===Ce?e.substring(8).replace(")","").replace("&",s):s+e}else e=s+" "+e;C+=0===fe?e:","+e}O=N=C}}else 125===Z&&(0!==U&&U--,0===U&&1===K&&(t=t.substring(0,T+1)+q+t.substring(T+1),X+=q.length,q="",K=0,G++));0!==D?(125===Z?G++:123===Z&&0!==G&&G--,1!==M||123!==Z&&0!==G||0===B.length||(M=0,N=s+" {"+B+"}"+N,B=""),0===G?(0===f?N="":1===f?(N="}@"+z+"}",z=""):3===f&&(E[R].body=z,R="",N="",z=""),f=0,G--,D--):1===f||3===f?(z+=N,3===f&&(N="")):2===f&&0===U&&(125!==Z&&(0===M&&(B=""),B+=N,N=""),M=1)):0===U&&125!==Z&&(L=1,B=void 0===B?N:B+N,N="")}F+=N,N="",125!==Z||0!==I||0!==f&&4!==f||(123!==F.charCodeAt(F.length-2)&&(c&&0!==F.length&&(w=n(3,F,W,V),null!=w&&(F=w)),Y+=F.trim()),4===f&&(c&&(w=n(3,y,W,V),null!=w&&(y=w)),f=0,Y+=y),F="")}T++,V++}if(void 0!==B&&0!==B.length&&(B=s+" {"+B+"}",c&&(w=n(4,B,W,V),null!=w&&(B=w)),Y+=B),l&&void 0!==j)for(var p=0,v=j.length;p<v;p++)Y=Y.replace(new RegExp("var\\("+j[p][0]+"\\)","g"),j[p][1]);return c&&(w=n(6,Y,W,V),null!=w&&(Y=w)),Y}return r.use=function(e,t){var i=this.plugins,l=i.length;if(null==t&&(t=e,e=void 0),t instanceof Array)for(var n=0,l=t.length;n<l;n++)i[l++]=t[n];else if(null==e)i[l]=t;else{var s=e instanceof RegExp?e:new RegExp(e+"\\([ \\t\\r\\n]*([^\\0]*?)[ \\t\\r\\n]*\\)","g"),a=/[ \t\r\n]*,[ \t\r\n]*/g;i[l]=function(e,r,i,l){if(6===e)return r=r.replace(s,function(e,r){var i=r.replace(a,",").split(","),l=t.apply(null,i);return null!=l?l:e})}}return r},r.plugins=[],r});
!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(global):"function"==typeof define&&define.amd?define(e(window)):window.stylis=e(window)}(function(e){"use strict";function r(e,t,i,l,n){e+="";var s="",a="",f=e.charCodeAt(0)||0;if(91===f){var o=e.substring(1,e.length-1).split("="),g=(a=o[1]).charCodeAt(0);34!==g&&39!==g||(a=a.substring(1,a.length-1)),s="["+o[0]+'="'+a+'"]'}else a=35===f||46===f||62===f?(s=e).substring(1):s=e;f=0;var u;void 0==i||i===!0?(i=!0,u=a):(u="",i=!1);var c,h=null!=n;if(h){var d=(typeof n).charCodeAt(0);111===d?r.use(n,null):102!==d&&(h=!1)}0!==(c=r.plugins).length&&(n=function(e,r,t,i){for(var l=r,n=0,s=c.length;n<s;n++)l=c[n](e,l,t,i)||l;return l!==r?l:void 0},h=!0);var p,b,v,A,m,x,C,y,w,O,k,j="",E="",R="",N="",z="",F=0,q=0,B=0,D=0,G=0,H=0,I=0,J=0,K="-moz-",L="-ms-",M="-webkit-";h&&(x=n(0,t,T,S),null!=x&&(t=x));for(var P=0,Q=0,S=0,T=1,U=t.length,V="";P<U;){var W=t.charCodeAt(P);if(0!==G||123!==W&&125!==W&&59!==W)13===W||10===W?(2===D&&(j="",D=0),S=0,T++):9!==W&&(34===W?G=34===G?0:39===G?39:34:39===W?G=39===G?0:34===G?34:39:47===W&&47===W&&D<2&&D++,j+=t.charAt(P));else{j+=t.charAt(P);var X=j.charCodeAt(0);32===X&&(X=(j=j.trim()).charCodeAt(0));var Y=j.charCodeAt(1)||0,Z=j.charCodeAt(2)||0;if(h&&125!==W&&(x=123===W?n(1,j.substring(0,j.length-1).trim(),T,S):n(2,j,T,S),null!=x&&(j=123===W?x+"{":x)),2===D)125===W&&(D=0),j="";else if(64===X){if(1===I&&0!==z.length&&(I=0,z=s+" {"+z+"}",h&&(x=n(4,z,T,S),null!=x&&(z=x)),V+=z,z=""),107===Y||103===Y)107===Y?(E=j.substring(1,11)+u+j.substring(11),j="@"+M+E,f=1):j="";else if(109===Y)if(l===!0&&105===Z)void 0===O&&(O={}),E=(k=j.substring(7,j.indexOf("{"))+" ").trim(),k=k.substring(0,k.indexOf(" ")).trim(),O[k]={key:E.trim(),body:""},f=3,j="",E="";else if(101===Z)if(0!==Q){for(P++,m="",b="",v=C.split(","),B=1;P<U&&(g=t.charCodeAt(P),123===g?B++:125===g&&B--,0!==B);)b+=t.charAt(P++);for(var $=0,_=v.length;$<_;$++)e=v[$],m+=r(($===_-1?e.substring(0,e.length-1):e).trim(),b,i,l,n);m=j+m+"}",j="",f=4}else f=2;else f=6;if(105===Y){if(l===!0&&110===Z)if(j=j.substring(9,j.length-1),y=j.indexOf("("),y>-1){var ee=j.substring(0,y),re=O[ee],te=j.substring(ee.length+1,j.length-1).split(","),ie=re.key.replace(ee,"").replace(/\(|\)/g,"").trim().split(",");j=re.body;for(var $=0,_=te.length;$<_;$++){var le=ie[$].trim();void 0!==le&&(j=j.replace(new RegExp("var\\(~~"+le+"\\)","g"),te[$].trim()))}t+=j,U+=j.length,j=""}else j=O[j].body,0===Q&&(t+=j,U+=j.length,j="");else if(109===Z&&h){var ne=/@import.*?(["'`][^\.\n\r]*?["'`];|["'`][^:\r\n]*?\.[^c].*?["'`])/g.exec(j);null!==ne&&(j=n(5,ne[1].replace(/['"; ]/g,""),T,S)||"",j&&(t=t.substring(0,P+1)+j+t.substring(P+1),U+=j.length),j="")}}else 4!==f&&(q=-1,F++)}else if(l===!0&&59===W&&126===X&&126===Y)p=j.indexOf(":"),void 0===w&&(w=[]),w[w.length]=[j.substring(0,p),j.substring(p+1,j.length-1).trim()],j="";else{if(97===X&&110===Y&&105===Z){j=j.substring(0,j.length-1),p=j.indexOf(":")+1,A=j.substring(0,p);var se=j.substring(p).trim().split(",");if(i===!0&&45!==(j.charCodeAt(9)||0))for(var ae=0,_=se.length;ae<_;ae++){for(var fe=se[ae],oe=fe.split(" "),ge=0,ue=oe.length;ge<ue;ge++){var ce=oe[ge].trim(),he=ce.charCodeAt(0),Z=ce.charCodeAt(2),de=ce.length,pe=ce.charCodeAt(de-1);41===pe||0===de||105===he&&102===Z&&101===pe&&8===de||108===he&&110===Z&&114===pe&&6===de||97===he&&116===Z&&101===pe&&(9===de||17===de)||110===he&&114===Z&&108===pe&&6===de||98===he&&99===Z&&115===pe&&9===de||102===he&&114===Z&&115===pe&&8===de||98===he&&116===Z&&104===pe&&4===de||110===he&&110===Z&&101===pe&&4===de||114===he&&110===Z&&103===pe&&7===de||112===he&&117===Z&&100===pe&&6===de||114===he&&118===Z&&100===pe&&8===de||115===he&&101===Z&&(116===pe&&10===de||100===pe&&8===de)||101===he&&115===Z&&(101===pe&&4===de||(11===de||7===de||8===de)&&45===ce.charCodeAt(4))||!isNaN(parseFloat(ce))||ce.indexOf("(")!==-1||(oe[ge]=u+ce)}A+=(0===ae?"":",")+oe.join(" ").trim()}else A+=(110!==(j.charCodeAt(10)||0)?"":u)+se[0].trim();j=M+A+";"+A+";"}else if(97===X&&112===Y&&112===Z)j=M+j+K+j+j;else if(100===X&&105===Y&&115===Z)j.indexOf("flex")>-1&&(j="display:"+M+"box;display:"+M+"flex;"+L+"flexbox;display:flex;");else if(116===X&&114===Y&&97===Z)j=M+j+(102===j.charCodeAt(5)?L+j:"")+j;else if(104===X&&121===Y&&112===Z||117===X&&115===Y&&101===Z)j=M+j+K+j+L+j+j;else if(102===X&&108===Y&&101===Z)j=M+j+L+j+j;else if(111===X&&114===Y&&100===Z)j=M+j+L+"flex-"+j+j;else if(97===X&&108===Y&&105===Z&&45===(j.charCodeAt(5)||0))switch(j.charCodeAt(6)||0){case 105:x=j.replace("-items",""),j=M+"box-"+x+L+"flex-"+x+j;break;case 115:j=L+"flex-item-"+j.replace("-self","")+j;break;default:j=L+"flex-line-pack"+j.replace("align-content","")+j}else if(123===W){if(Q++,1===I&&0!==z.length&&(I=0,z=s+" {"+z+"}",h&&(x=n(4,z,T,S),null!=x&&(z=x)),V+=z,z=""),0===F||2===f)if(2===Q){P++,b="";var be=j.substring(0,j.length-1).split(","),ve=C.substring(0,C.length-1).split(",");for(B=1;P<U&&(g=t.charCodeAt(P),123===g?B++:125===g&&B--,0!==B);)b+=t.charAt(P++);for(var ae=0,_=ve.length;ae<_;ae++){x=ve[ae],ve[ae]="";for(var ge=0,ue=be.length;ge<ue;ge++)e=x.replace(s,"").trim(),e=be[ge].indexOf(" &")>0?be[ge].replace("&","").trim()+" "+e:e+" "+be[ge].trim(),ve[ae]+=e.trim()+(ge===ue-1?"":",")}j="\n"+ve.join(",")+" {"+b+"}",N+=j.replace(/&| +&/g,""),H=1,j="",Q--}else{v=j.split(","),A="";for(var ae=0,_=v.length;ae<_;ae++){var Ae=(e=v[ae]).charCodeAt(0);if(32===Ae&&(Ae=(e=e.trim()).charCodeAt(0)),91===Ae)for(var ge=ae+1,ue=_-ae;ge<ue;ge++){var me=(e+=","+v[ge]).trim();if(93===me.charCodeAt(me.length-1)){_-=ge,v.splice(ae,ge);break}}if(38===Ae)e=s+e.substring(1);else if((y=e.indexOf(" &"))>0&&(Ae=58,e=":global("+e.substring(0,y)+")"+e.substring(y)),58===Ae){var xe=e.charCodeAt(1);if(104===xe&&116===e.charCodeAt(4)){var Ce=(e=e.substring(5)).charCodeAt(0);40===Ce?e=s+e.substring(1).replace(")",""):45===Ce?(y=e.indexOf(")"),e=e.substring(9,y)+" "+s+e.substring(y+1)):e=s+e}else e=103===xe?e.substring(8).replace(")","").replace("&",s):s+e}else e=s+" "+e;A+=0===ae?e:","+e}C=j=A}}else 125===W&&(0!==Q&&Q--,0===Q&&1===H&&(t=t.substring(0,P+1)+N+t.substring(P+1),U+=N.length,N="",H=0,q++));0!==F?(125===W?q++:123===W&&0!==q&&q--,1!==J||123!==W&&0!==q||0===z.length||(J=0,j=s+" {"+z+"}"+j,z=""),0===q?(0===f?j="":1===f?(j="}@"+E+"}",E=""):3===f&&(O[k].body=E,k="",j="",E=""),f=0,q--,F--):1===f||3===f?(E+=j,3===f&&(j="")):2===f&&0===Q&&(125!==W&&(0===J&&(z=""),z+=j,j=""),J=1)):0===Q&&125!==W&&(I=1,z=void 0===z?j:z+j,j="")}R+=j,j="",125!==W||0!==D||0!==f&&4!==f||(123!==R.charCodeAt(R.length-2)&&(h&&0!==R.length&&(x=n(3,R,T,S),null!=x&&(R=x)),V+=R.trim()),4===f&&(h&&(x=n(3,m,T,S),null!=x&&(m=x)),f=0,V+=m),R="")}P++,S++}if(void 0!==z&&0!==z.length&&(z=s+" {"+z+"}",h&&(x=n(4,z,T,S),null!=x&&(z=x)),V+=z),l&&void 0!==w)for(var $=0,_=w.length;$<_;$++)V=V.replace(new RegExp("var\\("+w[$][0]+"\\)","g"),w[$][1]);return h&&(x=n(6,V,T,S),null!=x&&(V=x)),V}return r.use=function(e,t){var i=this.plugins,l=i.length;if(null==t&&(t=e,e=void 0),null!=t)if(t.constructor===Object)for(var n in t)this.use(n,t[n]);else if(t.constructor===Array)for(var s=0,l=t.length;s<l;s++)i[l++]=t[s];else if(null==e)i[l]=t;else{var a=e instanceof RegExp?e:new RegExp(e+"\\([ \\t\\r\\n]*([^\\0]*?)[ \\t\\r\\n]*\\)","g"),f=/[ \t\r\n]*,[ \t\r\n]*/g;i[l]=function(e,r,i,l){if(6===e)return r=r.replace(a,function(e,r){var i=r.replace(f,",").split(","),l=t.apply(null,i);return null!=l?l:e})}}return r},r.plugins=[],r});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc