UNPKG

unnestcss

Version:
3 lines (2 loc) 722 B
"use strict";Object.defineProperty(exports,`__esModule`,{value:!0});var e=require(`./stylis/enum.cjs`),t=require(`./stylis/tokenizer.cjs`);const n=`host`,r=r=>{r.type===e.RULESET&&r.parent?.value.startsWith(e.COLON+n)&&(r.props=r.props.map(r=>{let i=new t.Tokenizer(r).tokenize(),a,o=i.length,s=!1;for(let t=0;t<i.length;t++){let r=i[t];switch(r){case e.COLON:if(i.length>t+2&&i[t+1]===n){let n=i[t+2];(n===e.COLON||n.startsWith(e.LEFT_SQUARE_BRACKET)&&n.endsWith(e.RIGHT_SQUARE_BRACKET))&&(a=t+2,s=!0)}break;case e.SPACE:case e.GREATER_THAN:case e.TILDE:case e.PLUS:s&&(o=t);break}}return s?`:${n}(${i.slice(a,o).join(``)})${i.slice(o).join(``)}`:r}))};exports.default=r,exports.host=r; //# sourceMappingURL=host.cjs.map