@master/css 2.0.0-beta.127 → 2.0.0-beta.128
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/config/rules.js +1 -1
- package/dist/esm/bin/index.mjs +2 -0
- package/dist/esm/config/colors.mjs +1 -0
- package/dist/esm/config/index.mjs +1 -0
- package/dist/esm/config/rules.mjs +1 -0
- package/dist/esm/constants/sizing-values.mjs +1 -0
- package/dist/esm/css.mjs +1 -0
- package/dist/esm/index.browser.mjs +1 -0
- package/dist/esm/index.mjs +1 -0
- package/dist/esm/methods/fill-color-scale.mjs +1 -0
- package/dist/esm/methods/index.mjs +1 -0
- package/dist/esm/methods/render-from-html.mjs +1 -0
- package/dist/esm/methods/render-into-html.mjs +1 -0
- package/dist/esm/methods/render.mjs +1 -0
- package/dist/esm/rule.mjs +1 -0
- package/dist/esm/utils/analyze-value-token.mjs +1 -0
- package/dist/esm/utils/is-plain-object.mjs +1 -0
- package/dist/esm/utils/is-symbol.mjs +1 -0
- package/dist/esm/utils/normalize-css-calc-text.mjs +1 -0
- package/dist/esm/utils/parse-rule-value.mjs +1 -0
- package/dist/esm/utils/parse-value-unit.mjs +1 -0
- package/dist/index.browser.js +1 -1
- package/dist/index.js +3 -3
- package/dist/index.mjs +4 -4
- package/package.json +1 -1
- package/dist/esm/bin/index.js +0 -2
- package/dist/esm/config/colors.js +0 -1
- package/dist/esm/config/index.js +0 -1
- package/dist/esm/config/rules.js +0 -1
- package/dist/esm/constants/sizing-values.js +0 -1
- package/dist/esm/css.js +0 -1
- package/dist/esm/index.browser.js +0 -1
- package/dist/esm/index.js +0 -1
- package/dist/esm/methods/fill-color-scale.js +0 -1
- package/dist/esm/methods/index.js +0 -1
- package/dist/esm/methods/render-from-html.js +0 -1
- package/dist/esm/methods/render-into-html.js +0 -1
- package/dist/esm/methods/render.js +0 -1
- package/dist/esm/rule.js +0 -1
- package/dist/esm/utils/analyze-value-token.js +0 -1
- package/dist/esm/utils/is-plain-object.js +0 -1
- package/dist/esm/utils/is-symbol.js +0 -1
- package/dist/esm/utils/normalize-css-calc-text.js +0 -1
- package/dist/esm/utils/parse-rule-value.js +0 -1
- package/dist/esm/utils/parse-value-unit.js +0 -1
- /package/dist/esm/config/{breakpoints.js → breakpoints.mjs} +0 -0
- /package/dist/esm/config/{important.js → important.mjs} +0 -0
- /package/dist/esm/config/{observe.js → observe.mjs} +0 -0
- /package/dist/esm/config/{override.js → override.mjs} +0 -0
- /package/dist/esm/config/{root-size.js → root-size.mjs} +0 -0
- /package/dist/esm/config/{scope.js → scope.mjs} +0 -0
- /package/dist/esm/config/{selectors.js → selectors.mjs} +0 -0
- /package/dist/esm/config/{semantics.js → semantics.mjs} +0 -0
- /package/dist/esm/config/{themes.js → themes.mjs} +0 -0
- /package/dist/esm/constants/{box-underneath.js → box-underneath.mjs} +0 -0
- /package/dist/esm/constants/{content-extrema.js → content-extrema.mjs} +0 -0
- /package/dist/esm/constants/{selector-symbols.js → selector-symbols.mjs} +0 -0
- /package/dist/esm/constants/{sorted-selectors.js → sorted-selectors.mjs} +0 -0
- /package/dist/esm/constants/{start-symbol.js → start-symbol.mjs} +0 -0
- /package/dist/esm/methods/{define-content.js → define-content.mjs} +0 -0
- /package/dist/esm/polyfills/{css-escape.js → css-escape.mjs} +0 -0
- /package/dist/esm/{theme.js → theme.mjs} +0 -0
- /package/dist/esm/utils/{analyze-unit-value.js → analyze-unit-value.mjs} +0 -0
- /package/dist/esm/utils/{concat-arrays.js → concat-arrays.mjs} +0 -0
- /package/dist/esm/utils/{css-escape.js → css-escape.mjs} +0 -0
- /package/dist/esm/utils/{delay.js → delay.mjs} +0 -0
- /package/dist/esm/utils/{get-border-props.js → get-border-props.mjs} +0 -0
- /package/dist/esm/utils/{get-css-property-text.js → get-css-property-text.mjs} +0 -0
- /package/dist/esm/utils/{get-type.js → get-type.mjs} +0 -0
- /package/dist/esm/utils/{hex-to-rgb.js → hex-to-rgb.mjs} +0 -0
- /package/dist/esm/utils/{read-package.js → read-package.mjs} +0 -0
- /package/dist/esm/utils/{rgb-to-hex.js → rgb-to-hex.mjs} +0 -0
package/dist/cjs/config/rules.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var y=Object.defineProperty;var $=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var R=Object.prototype.hasOwnProperty;var A=(e,t)=>{for(var r in t)y(e,r,{get:t[r],enumerable:!0})},T=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of C(t))!R.call(e,n)&&n!==r&&y(e,n,{get:()=>t[n],enumerable:!(s=$(t,n))||s.enumerable});return e};var I=e=>T(y({},"__esModule",{value:!0}),e);var z={};A(z,{rules:()=>N});module.exports=I(z);var f=require("../utils/analyze-value-token"),b=require("../utils/get-border-props"),v=require("../utils/parse-value-unit"),k=require("../constants/start-symbol"),p=require("../constants/box-underneath"),x=require("../constants/content-extrema"),m=require("../constants/sizing-values"),w=require("../utils/css-escape"),N={group:{matches:"^(?:.+?[*_>~+])?\\{.+?\\}",unit:"",prop:!1,analyzeToken(e,t,r){let s=0;for(;s<e.length&&!(e[s]==="{"&&e[s-1]!=="\\");s++);return[e.slice(0,s),...(0,f.analyzeValueToken)(e.slice(s),t,r)]},getThemeProps(e,t){let r={},s=(o,a)=>{let i=a.indexOf(":");if(i!==-1){o in r||(r[o]={});let c=r[o],h=a.slice(0,i);h in c||(c[h]=a.slice(i+1))}},n=o=>{let a=(i,c)=>{let h=c.slice((0,w.cssEscape)(o.className).length).match(/\{(.*)\}/)[1].split(";");for(let S of h)s(i,S)};if(this.theme){let i=o.natives.find(c=>c.theme===this.theme)??o.natives.find(c=>!c.theme);i&&a(this.theme,i.text)}else for(let i of o.natives)a(i.theme,i.text)},u=[],l="",d=()=>{l&&(u.push(l.replace(/ /g,"")),l="")},g=1;(function o(a){for(;g<e.value.length;g++){let i=e.value[g];if(!a){if(i===";"){d();continue}if(i==="}")break}if(l+=i,a===i){if(a==="'"||a==='"'){let c=0;for(let h=l.length-2;l[h]==="\\";h--)c++;if(c%2)continue}break}else i in k.START_SYMBOL&&a!=="'"&&a!=='"'&&(g++,o(k.START_SYMBOL[i]))}})(void 0),d();for(let o of u){let a=t.create(o);if(Array.isArray(a))for(let i of a)n(i);else a?n(a):s(this.theme??"",o)}return r}},variable:{matches:"^\\$[^ (){}A-Z]+:[^ ]",unit:"",prop:!1,get(e){return{["--"+this.prefix.slice(1,-1)]:e}}},fontSize:{matches:"^f(?:ont)?:(?:[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},fontWeight:{matches:"^f(?:ont)?:(?:bolder|$values)(?!\\|)",unit:"",values:{thin:100,extralight:200,light:300,regular:400,medium:500,semibold:600,bold:700,extrabold:800,heavy:900}},fontFamily:{matches:"^f(?:ont)?:(?:$values)(?!\\|)",values:{mono:"ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace",sans:"ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji",serif:"ui-serif,Georgia,Cambria,Times New Roman,Times,serif"}},fontSmoothing:{matches:"^f(?:ont)?:(?:antialiased|subpixel-antialiased|$values)(?!\\|)",unit:"",prop:!1,get(e){let t={};switch(e.value){case"subpixel-antialiased":t["-webkit-font-smoothing"]=t["-moz-osx-font-smoothing"]={...e,value:"auto"};break;case"antialiased":t["-webkit-font-smoothing"]={...e,value:"antialiased"},t["-moz-osx-font-smoothing"]={...e,value:"grayscale"};break}return t}},fontStyle:{matches:"^f(?:ont)?:(?:normal|italic|oblique|$values)(?!\\|)",unit:"deg"},fontVariantNumeric:{matches:"^f(?:ont)?:(?:ordinal|slashed-zero|lining-nums|oldstyle-nums|proportional-nums|tabular-nums|diagonal-fractions|stacked-fractions|$values)(?!\\|)"},fontFeatureSettings:{matches:"^font-feature:."},font:{matches:"^f:.",unit:"",order:-1},color:{matches:"^(?:color|fg|foreground):.",colorful:!0,unit:""},spacing:{matches:"^[pm][xytblr]?:.",prop:!1,get(e){let r=this.prefix[0]==="m"?"margin":"padding",s=r+"-left",n=r+"-right",u=r+"-top",l=r+"-bottom";switch(this.prefix[1]){case"x":return{[s]:e,[n]:e};case"y":return{[u]:e,[l]:e};case"l":return{[s]:e};case"r":return{[n]:e};case"t":return{[u]:e};case"b":return{[l]:e};default:return{[r]:e}}},get order(){return this.prefix==="p:"||this.prefix==="m:"?-1:0}},margin:{matches:"^margin(?:-(?:left|right|top|bottom))?:.",prop:!1,get(e){return{[this.prefix.slice(0,-1)]:e}},get order(){return this.prefix==="margin:"?-1:0}},padding:{matches:"^padding(?:-(?:left|right|top|bottom))?:.",prop:!1,get(e){return{[this.prefix.slice(0,-1)]:e}},get order(){return this.prefix==="padding:"?-1:0}},flexBasis:{values:m.SIZING_VALUES},flexWrap:{matches:"^flex:(?:wrap(?:-reverse)?|nowrap|$values)(?!\\|)"},flexGrow:{unit:""},flexShrink:{unit:""},flexDirection:{matches:"^flex:(?:(?:row|column)(?:-reverse)?|$values)(?!\\|)",values:{col:"column","col-reverse":"column-reverse"}},flex:{unit:"",order:-1},display:{matches:"^d:."},width:{matches:"^w:.",values:m.SIZING_VALUES},height:{matches:"^h:.",values:m.SIZING_VALUES},minWidth:{matches:"^min-w:.",values:m.SIZING_VALUES},minHeight:{matches:"^min-h:.",values:m.SIZING_VALUES},wH:{matches:"^(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",prop:!1,analyzeToken(e,t,r){return["",...(0,f.analyzeValueToken)(e,t,r,["x"])]},get(e){let[t,r]=e.value.split(" x ");return{width:{...e,value:t},height:{...e,value:r}}}},minWH:{matches:"^min:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",prop:!1,analyzeToken(e,t,r){return["",...(0,f.analyzeValueToken)(e.slice(4),t,r,["x"])]},get(e){let[t,r]=e.value.split(" x ");return{"min-width":{...e,value:t},"min-height":{...e,value:r}}}},maxWH:{matches:"^max:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",prop:!1,analyzeToken(e,t,r){return["",...(0,f.analyzeValueToken)(e.slice(4),t,r,["x"])]},get(e){let[t,r]=e.value.split(" x ");return{"max-width":{...e,value:t},"max-height":{...e,value:r}}}},contain:{},content:{},counterIncrement:{unit:""},counterReset:{unit:""},letterSpacing:{matches:"^ls:.",unit:"em"},lineHeight:{matches:"^lh:.",unit:""},objectFit:{matches:"^(?:object|obj):(?:contain|cover|fill|scale-down|$values)"},objectPosition:{matches:"^(?:object|obj):(?:top|bottom|right|left|center|$values)"},textAlign:{matches:"^t(?:ext)?:(?:justify|center|left|right|start|end|$values)(?!\\|)"},textDecorationColor:{colorStarts:"text-decoration:",colorful:!0},textDecorationStyle:{matches:"^t(?:ext)?:(?:solid|double|dotted|dashed|wavy|$values)(?!\\|)"},textDecorationThickness:{matches:"^text-decoration:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|from-font|$values)[^|]*$",unit:"em"},textDecorationLine:{matches:"^t(?:ext)?:(?:none|underline|overline|line-through|$values)(?!\\|)"},textDecoration:{matches:"^t(?:ext)?:(?:underline|line-through|overline|$values)",colorful:!0,order:-1},textUnderlineOffset:{},textOverflow:{matches:"^(?:text-(?:overflow|ovf):.|t(?:ext)?:(?:ellipsis|clip|$values)(?!\\|))"},textOrientation:{matches:"^t(?:ext)?:(?:mixed|upright|sideways-right|sideways|use-glyph-orientation|$values)(?!\\|)"},textTransform:{matches:"^t(?:ext)?:(?:uppercase|lowercase|capitalize|$values)(?!\\|)"},textRendering:{matches:"^t(?:ext)?:(?:optimizeSpeed|optimizeLegibility|geometricPrecision|$values)(?!\\|)"},textIndent:{},verticalAlign:{matches:"^(?:v|vertical):."},columns:{matches:"^(?:columns|cols):.",unit:"",order:-1},whiteSpace:{unit:""},inset:{matches:"^(?:top|bottom|left|right):.",get(e){return{[this.prefix.slice(0,-1)]:e}}},lines:{matches:"^lines:.",unit:"",prop:!1,get(e){return{overflow:{...e,value:"hidden"},display:{...e,value:"-webkit-box"},"overflow-wrap":{...e,value:"break-word"},"text-overflow":{...e,value:"ellipsis"},"-webkit-box-orient":{...e,value:"vertical"},"-webkit-line-clamp":e}}},maxHeight:{matches:"^max-h:.",values:m.SIZING_VALUES},maxWidth:{matches:"^max-w:.",values:m.SIZING_VALUES},boxSizing:{matches:"^box:(?:$values)(?!\\|)",values:{content:"content-box",border:"border-box"}},opacity:{unit:""},visibility:{},clear:{},float:{},isolation:{},overflow:{matches:"^overflow(?:-x|-y)?:(?:visible|overlay|hidden|scroll|auto|clip|inherit|initial|revert|revert-layer|unset|\\$|var|$values)",prop:!1,get(e){if(this.prefix)switch(this.prefix.slice(-2,-1)){case"x":return{"overflow-x":e};case"y":return{"overflow-y":e}}return{overflow:e}},get order(){return-1}},overscrollBehavior:{matches:"^overscroll-behavior(?:-[xy])?:",prop:!1,get(e){switch(this.prefix.slice(-2,-1)){case"x":return{"overscroll-behavior-x":e};case"y":return{"overscroll-behavior-y":e};default:return{"overscroll-behavior":e}}}},zIndex:{matches:"^z:.",unit:""},position:{values:{abs:"absolute",rel:"relative"}},cursor:{},pointerEvents:{},resize:{},touchAction:{},wordBreak:{unit:""},wordSpacing:{unit:"em"},userDrag:{get(e){return{"user-drag":e,"-webkit-user-drag":e}}},userSelect:{get(e){return{"user-select":e,"-webkit-user-select":e}}},textShadow:{colorful:!0},textSize:{matches:"^t(?:ext)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",prop:!1,get(e){let{unit:t,value:r}=e,s=.75;return{"font-size":e,"line-height":{...e,value:t==="em"?r+s+t:`calc(${r}${t} + ${s}em)`,unit:""}}}},textFillColor:{matches:"^text-fill-color:.",colorStarts:"(?:text-fill|text|t):",colorful:!0,prop:!1,get(e){return{"-webkit-text-fill-color":e}}},textStrokeWidth:{matches:"^text-stroke(:(thin|medium|thick|\\.?[0-9]+|$values)(?!\\|)|-width:.)",prop:!1,get(e){return{"-webkit-text-stroke-width":e}}},textStrokeColor:{matches:"^text-stroke-color:.",colorStarts:"text-stroke:",colorful:!0,prop:!1,get(e){return{"-webkit-text-stroke-color":e}}},textStroke:{matches:"^text-stroke:.",prop:!1,get(e){return{"-webkit-text-stroke":e}}},boxShadow:{matches:"^s(?:hadow)?:.",colorful:!0},tableLayout:{},transformBox:{matches:"^transform:(?:$values)(?!\\|)",values:{...p.BOX_UNDERNEATH,fill:"fill-box",stroke:"stroke-box",view:"view-box"}},transformStyle:{matches:"^transform:(?:flat|preserve-3d|$values)(?!\\|)"},transformOrigin:{matches:"^transform:(?:top|bottom|right|left|center|[0-9]|$values)",unit:"px"},transform:{matches:"^(?:translate|scale|skew|rotate|perspective|matrix)(?:3d|[XYZ])?\\(",unit:"",parseValue(e,{rootSize:t}){return e.replace(/(translate|scale|skew|rotate|perspective|matrix)(3d|[XYZ])?\((.*?)\)/g,(r,s,n,u)=>{let l,d;switch(s){case"translate":l="rem";break;case"skew":l="deg";break;case"rotate":n==="3d"&&(d=!0),l="deg";break;default:return r}let g=u.split(",");return r.replace(u,g.map((o,a)=>!d||g.length-1===a?Number.isNaN(+o)?o:o/(l==="rem"?t:1)+l:o).join(","))})}},transitionProperty:{matches:"^~property:."},transitionTimingFunction:{matches:"^~easing:."},transitionDuration:{matches:"^~duration:.",unit:"ms"},transitionDelay:{matches:"^~delay:.",unit:"ms"},transition:{symbol:"~",order:-1},animationDelay:{matches:"^@delay:.",unit:"ms"},animationDirection:{matches:"^@direction:."},animationDuration:{matches:"^@duration:.",unit:"ms"},animationFillMode:{matches:"^@fill-mode:."},animationIterationCount:{matches:"^@iteration-count:.",unit:""},animationName:{matches:"^@name:."},animationPlayState:{matches:"^@play-state:."},animationTimingFunction:{matches:"^@easing:."},animation:{symbol:"@",unit:"",order:-1},borderColor:{matches:"^border(?:-(?:left|right|top|bottom))?-color:.",colorStarts:"b(?:[xytblr]|(?:order(?:-(?:left|right|top|bottom))?))?:",colorful:!0,prop:!1,get(e){return(0,b.getBorderProps)(this.prefix,e,"color")},get order(){return this.prefix==="border-color:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderRadius:{matches:"^(?:r[tblr]?[tblr]?|border(?:-(?:top|bottom)-(?:left|right))?-radius):.",prop:!1,get(e){if(this.prefix){let r="",s=this.prefix.split("-");if(s.length>1)for(let n=1;n<s.length-1;n++)r+=s[n][0];else r=this.prefix.slice(1,-1);switch(r){case"t":return{"border-top-left-radius":e,"border-top-right-radius":e};case"tl":case"lt":return{"border-top-left-radius":e};case"rt":case"tr":return{"border-top-right-radius":e};case"b":return{"border-bottom-left-radius":e,"border-bottom-right-radius":e};case"bl":case"lb":return{"border-bottom-left-radius":e};case"br":case"rb":return{"border-bottom-right-radius":e};case"l":return{"border-top-left-radius":e,"border-bottom-left-radius":e};case"r":return{"border-top-right-radius":e,"border-bottom-right-radius":e};default:return{"border-radius":e}}}let t=this.prefix?.slice(0,-1);return{[["border-top-left-radius","border-top-right-radius","border-bottom-left-radius","border-bottom-right-radius"].includes(t)?t:"border-radius"]:e}},get order(){return this.prefix==="border-radius:"||this.prefix==="r:"?-1:0}},borderStyle:{matches:"^(?:border(?:-(?:left|right|top|bottom))?-style:.|b(?:[xytblr]|order(?:-(?:left|right|top|bottom))?)?:(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|))",prop:!1,get(e){return(0,b.getBorderProps)(this.prefix,e,"style")},get order(){return this.prefix==="border-style:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderWidth:{matches:"^(?:border(?:-(?:left|right|top|bottom))?-width:.|b(?:[xytblr]|order(?:-(?:left|right|top|bottom))?)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$)",prop:!1,get(e){return(0,b.getBorderProps)(this.prefix,e,"width")},get order(){return this.prefix==="border-width:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderCollapse:{matches:"^b(?:order)?:(?:collapse|separate|$values)(?!\\|)"},borderSpacing:{},borderImageOutset:{},borderImageRepeat:{matches:"^border-image:(?:stretch|repeat|round|space|$values)(?!\\|)"},borderImageSlice:{unit:""},borderImageSource:{matches:"^border-image:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)"},borderImageWidth:{matches:"^border-image:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},borderImage:{unit:""},border:{matches:"^b(?:[xytblr]?|order(?:-(?:left|right|top|bottom))?):.",colorful:!0,prop:!1,get(e){return(0,b.getBorderProps)(this.prefix,e)},get order(){return this.prefix==="border:"||this.prefix==="b:"?-2:-1}},backgroundAttachment:{matches:"^(?:bg|background):(?:fixed|local|scroll|$values)(?!\\|)"},backgroundBlendMode:{},backgroundColor:{colorStarts:"(?:bg|background):",unit:"",colorful:!0},backgroundClip:{matches:"^(?:bg|background):(?:text|$values)(?!\\|)",get(e){return{"-webkit-background-clip":e,"background-clip":e}},values:p.BOX_UNDERNEATH},backgroundOrigin:{matches:"^(?:bg|background):(?:$values)(?!\\|)",values:p.BOX_UNDERNEATH},backgroundPosition:{matches:"^(?:bg|background):(?:top|bottom|right|left|center|$values)(?!\\|)",unit:"px"},backgroundRepeat:{matches:"^(?:bg|background):(?:space|round|repeat|no-repeat|repeat-x|repeat-y|$values)(?![|a-zA-Z])"},backgroundSize:{matches:"^(?:bg|background):(?:\\.?\\[0-9]+|auto|cover|contain|$values)(?!\\|)"},backgroundImage:{matches:"^(?:bg|background):(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)",colorful:!0},background:{matches:"^bg:.",colorful:!0,order:-1},mixBlendMode:{matches:"^blend:."},backdropFilter:{matches:"^bd:.",colorful:!0,get(e){return{"backdrop-filter":e,"-webkit-backdrop-filter":e}},parseValue(e,t){return(0,v.parseValueUnit)(e,r=>{switch(r){case"blur":case"drop-shadow":return"rem";case"hue-rotate":return"deg"}return""},t)}},filter:{matches:"^(?:blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\\(",colorful:!0,parseValue(e,t){return(0,v.parseValueUnit)(e,r=>{switch(r){case"blur":case"drop-shadow":return"rem";case"hue-rotate":return"deg"}return""},t)}},fill:{colorStarts:"fill:",colorful:!0},strokeDasharray:{},strokeDashoffset:{},strokeWidth:{matches:"^stroke:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},stroke:{colorful:!0},x:{unit:""},y:{unit:""},cx:{unit:""},cy:{unit:""},rx:{unit:""},ry:{unit:""},gridColumnStart:{matches:"^grid-col-start:.",unit:""},gridColumnEnd:{matches:"^grid-col-end:.",unit:""},gridColumn:{matches:"^grid-col(?:umn)?(?:-span)?:.",unit:"",order:-1,parseValue(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridColumns:{matches:"^grid-cols:.",unit:"",get(e){return{display:{...e,value:"grid"},"grid-template-columns":{...this,value:"repeat("+e.value+",minmax(0,1fr))"}}}},gridRowStart:{unit:""},gridRowEnd:{unit:""},gridRow:{matches:"^grid-row-span:.",unit:"",order:-1,parseValue(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridRows:{unit:"",get(e){return{display:{...e,value:"grid"},"grid-auto-flow":{...e,value:"column"},"grid-template-rows":{...e,value:"repeat("+e.value+",minmax(0,1fr))"}}}},gridAutoColumns:{matches:"^grid-auto-cols:.",values:x.CONTENT_EXTREMA},gridAutoFlow:{matches:"^grid-flow:."},gridAutoRows:{values:x.CONTENT_EXTREMA},gridTemplateAreas:{},gridTemplateColumns:{matches:"^grid-template-cols:.",values:x.CONTENT_EXTREMA},gridTemplateRows:{values:x.CONTENT_EXTREMA},gridTemplate:{order:-1},gridArea:{unit:"",order:-1},grid:{order:-1},gap:{matches:"^gap(?:-x|-y)?:.",order:-1,prop:!1,get(e){switch(this.prefix[4]){case"x":return{"column-gap":e};case"y":return{"row-gap":e};default:return{gap:e}}}},order:{matches:"^o:.",unit:"",values:{first:-999999,last:999999}},breakInside:{},breakBefore:{},breakAfter:{},boxDecorationBreak:{matches:"^box:(?:slice|clone|$values)(?!\\|)",get(e){return{"box-decoration-break":e,"-webkit-box-decoration-break":e}}},aspectRatio:{matches:"^aspect:.",unit:""},columnSpan:{matches:"^col-span:."},alignContent:{matches:"^ac:."},alignItems:{matches:"^ai:."},alignSelf:{matches:"^as:"},justifyContent:{matches:"^jc:."},justifyItems:{matches:"^ji:."},justifySelf:{matches:"^js:."},placeContent:{order:-1},placeItems:{order:-1},placeSelf:{order:-1},listStylePosition:{matches:"^list-style:(?:inside|outside|$values)(?!\\|)"},listStyleType:{matches:"^list-style:(?:disc|decimal|$values)(?!\\|)"},listStyleImage:{matches:"^list-style:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)"},listStyle:{order:-1},outlineColor:{colorStarts:"outline:",colorful:!0},outlineOffset:{},outlineStyle:{matches:"^outline:(?:none|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)"},outlineWidth:{matches:"^outline:(?:\\.?[0-9]|medium|thick|thin|(max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},outline:{order:-1,colorful:!0},accentColor:{colorStarts:"accent:",colorful:!0},appearance:{},caretColor:{colorStarts:"caret:",colorful:!0},scrollBehavior:{},scrollMargin:{matches:"^scroll-m(?:[xytblr]|argin(?:-(?:top|bottom|left|right))?)?:.",prop:!1,get(e){if(this.prefix.slice(-3,-2)==="m")switch(this.prefix.slice(-2,-1)){case"x":return{"scroll-margin-left":e,"scroll-margin-right":e};case"y":return{"scroll-margin-top":e,"scroll-margin-bottom":e};case"l":return{"scroll-margin-left":e};case"r":return{"scroll-margin-right":e};case"t":return{"scroll-margin-top":e};case"b":return{"scroll-margin-bottom":e}}else return{[this.prefix.replace(/-m(?!argin)/,"-margin").slice(0,-1)]:e}},get order(){return this.prefix==="scroll-margin:"||this.prefix==="scroll-m:"?-1:0}},scrollPadding:{matches:"^scroll-p(?:[xytblr]|adding(?:-(?:top|bottom|left|right))?)?:.",prop:!1,get(e){if(this.prefix.slice(-3,-2)==="p")switch(this.prefix.slice(-2,-1)){case"x":return{"scroll-padding-left":e,"scroll-padding-right":e};case"y":return{"scroll-padding-top":e,"scroll-padding-bottom":e};case"l":return{"scroll-padding-left":e};case"r":return{"scroll-padding-right":e};case"t":return{"scroll-padding-top":e};case"b":return{"scroll-padding-bottom":e}}else return{[this.prefix.replace(/-p(?!adding)/,"-padding").slice(0,-1)]:e}},get order(){return this.prefix==="scroll-padding:"||this.prefix==="scroll-p:"?-1:0}},scrollSnapAlign:{matches:"^scroll-snap:(?:start|end|center|$values)"},scrollSnapStop:{matches:"^scroll-snap:(?:normal|always|$values)(?!\\|)"},scrollSnapType:{matches:"^scroll-snap:(?:(?:[xy]|block|inline|both)(?:\\|(?:proximity|mandatory))?|$values)(?!\\|)"},willChange:{},writingMode:{matches:"^writing:."},direction:{},shapeOutside:{matches:"^shape:(?:(?:inset|circle|ellipse|polygon|url|linear-gradient)\\(.*\\)|$values)(?!\\|)",values:{...p.BOX_UNDERNEATH,margin:"margin-box"}},shapeMargin:{matches:"^shape:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},shapeImageThreshold:{unit:""},clipPath:{matches:"^clip:.",values:{...p.BOX_UNDERNEATH,margin:"margin-box",fill:"fill-box",stroke:"stroke-box",view:"view-box"}},quotes:{},maskImage:{get(e){return{"mask-image":e,"-webkit-mask-image":e}}}};0&&(module.exports={rules});
|
|
1
|
+
var v=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var A=Object.prototype.hasOwnProperty;var T=(e,t)=>{for(var r in t)v(e,r,{get:t[r],enumerable:!0})},I=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of R(t))!A.call(e,n)&&n!==r&&v(e,n,{get:()=>t[n],enumerable:!(s=C(t,n))||s.enumerable});return e};var N=e=>I(v({},"__esModule",{value:!0}),e);var P={};T(P,{rules:()=>z});module.exports=N(P);var f=require("../utils/analyze-value-token"),b=require("../utils/get-border-props"),y=require("../utils/parse-value-unit"),k=require("../constants/start-symbol"),p=require("../constants/box-underneath"),x=require("../constants/content-extrema"),m=require("../constants/sizing-values"),S=require("../utils/css-escape");function w(e){if(this.prefix.includes("-"))return{[this.prefix.slice(0,-1)]:e};let r=this.prefix[0]==="m"?"margin":"padding",s=r+"-left",n=r+"-right",u=r+"-top",l=r+"-bottom";switch(this.prefix[1]){case"x":return{[s]:e,[n]:e};case"y":return{[u]:e,[l]:e};case"l":return{[s]:e};case"r":return{[n]:e};case"t":return{[u]:e};case"b":return{[l]:e};default:return{[r]:e}}}var z={group:{matches:"^(?:.+?[*_>~+])?\\{.+?\\}",unit:"",prop:!1,analyzeToken(e,t,r){let s=0;for(;s<e.length&&!(e[s]==="{"&&e[s-1]!=="\\");s++);return[e.slice(0,s),...(0,f.analyzeValueToken)(e.slice(s),t,r)]},getThemeProps(e,t){let r={},s=(o,a)=>{let i=a.indexOf(":");if(i!==-1){o in r||(r[o]={});let c=r[o],h=a.slice(0,i);h in c||(c[h]=a.slice(i+1))}},n=o=>{let a=(i,c)=>{let h=c.slice((0,S.cssEscape)(o.className).length).match(/\{(.*)\}/)[1].split(";");for(let $ of h)s(i,$)};if(this.theme){let i=o.natives.find(c=>c.theme===this.theme)??o.natives.find(c=>!c.theme);i&&a(this.theme,i.text)}else for(let i of o.natives)a(i.theme,i.text)},u=[],l="",d=()=>{l&&(u.push(l.replace(/ /g,"")),l="")},g=1;(function o(a){for(;g<e.value.length;g++){let i=e.value[g];if(!a){if(i===";"){d();continue}if(i==="}")break}if(l+=i,a===i){if(a==="'"||a==='"'){let c=0;for(let h=l.length-2;l[h]==="\\";h--)c++;if(c%2)continue}break}else i in k.START_SYMBOL&&a!=="'"&&a!=='"'&&(g++,o(k.START_SYMBOL[i]))}})(void 0),d();for(let o of u){let a=t.create(o);if(Array.isArray(a))for(let i of a)n(i);else a?n(a):s(this.theme??"",o)}return r}},variable:{matches:"^\\$[^ (){}A-Z]+:[^ ]",unit:"",prop:!1,get(e){return{["--"+this.prefix.slice(1,-1)]:e}}},fontSize:{matches:"^f(?:ont)?:(?:[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},fontWeight:{matches:"^f(?:ont)?:(?:bolder|$values)(?!\\|)",unit:"",values:{thin:100,extralight:200,light:300,regular:400,medium:500,semibold:600,bold:700,extrabold:800,heavy:900}},fontFamily:{matches:"^f(?:ont)?:(?:$values)(?!\\|)",values:{mono:"ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace",sans:"ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji",serif:"ui-serif,Georgia,Cambria,Times New Roman,Times,serif"}},fontSmoothing:{matches:"^f(?:ont)?:(?:antialiased|subpixel-antialiased|$values)(?!\\|)",unit:"",prop:!1,get(e){let t={};switch(e.value){case"subpixel-antialiased":t["-webkit-font-smoothing"]=t["-moz-osx-font-smoothing"]={...e,value:"auto"};break;case"antialiased":t["-webkit-font-smoothing"]={...e,value:"antialiased"},t["-moz-osx-font-smoothing"]={...e,value:"grayscale"};break}return t}},fontStyle:{matches:"^f(?:ont)?:(?:normal|italic|oblique|$values)(?!\\|)",unit:"deg"},fontVariantNumeric:{matches:"^f(?:ont)?:(?:ordinal|slashed-zero|lining-nums|oldstyle-nums|proportional-nums|tabular-nums|diagonal-fractions|stacked-fractions|$values)(?!\\|)"},fontFeatureSettings:{matches:"^font-feature:."},font:{matches:"^f:.",unit:"",order:-1},color:{matches:"^(?:color|fg|foreground):.",colorful:!0,unit:""},margin:{matches:"^m(?:argin(?:-(?:left|right|top|bottom))?|[xytblr]?):.",prop:!1,get:w,get order(){return this.prefix==="margin:"||this.prefix==="m:"?-1:0}},padding:{matches:"^p(?:adding(?:-(?:left|right|top|bottom))?|[xytblr]?):.",prop:!1,get:w,get order(){return this.prefix==="padding:"||this.prefix==="p:"?-1:0}},flexBasis:{values:m.SIZING_VALUES},flexWrap:{matches:"^flex:(?:wrap(?:-reverse)?|nowrap|$values)(?!\\|)"},flexGrow:{unit:""},flexShrink:{unit:""},flexDirection:{matches:"^flex:(?:(?:row|column)(?:-reverse)?|$values)(?!\\|)",values:{col:"column","col-reverse":"column-reverse"}},flex:{unit:"",order:-1},display:{matches:"^d:."},width:{matches:"^w:.",values:m.SIZING_VALUES},height:{matches:"^h:.",values:m.SIZING_VALUES},minWidth:{matches:"^min-w:.",values:m.SIZING_VALUES},minHeight:{matches:"^min-h:.",values:m.SIZING_VALUES},wH:{matches:"^(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",prop:!1,analyzeToken(e,t,r){return["",...(0,f.analyzeValueToken)(e,t,r,["x"])]},get(e){let[t,r]=e.value.split(" x ");return{width:{...e,value:t},height:{...e,value:r}}}},minWH:{matches:"^min:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",prop:!1,analyzeToken(e,t,r){return["",...(0,f.analyzeValueToken)(e.slice(4),t,r,["x"])]},get(e){let[t,r]=e.value.split(" x ");return{"min-width":{...e,value:t},"min-height":{...e,value:r}}}},maxWH:{matches:"^max:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",prop:!1,analyzeToken(e,t,r){return["",...(0,f.analyzeValueToken)(e.slice(4),t,r,["x"])]},get(e){let[t,r]=e.value.split(" x ");return{"max-width":{...e,value:t},"max-height":{...e,value:r}}}},contain:{},content:{},counterIncrement:{unit:""},counterReset:{unit:""},letterSpacing:{matches:"^ls:.",unit:"em"},lineHeight:{matches:"^lh:.",unit:""},objectFit:{matches:"^(?:object|obj):(?:contain|cover|fill|scale-down|$values)"},objectPosition:{matches:"^(?:object|obj):(?:top|bottom|right|left|center|$values)"},textAlign:{matches:"^t(?:ext)?:(?:justify|center|left|right|start|end|$values)(?!\\|)"},textDecorationColor:{colorStarts:"text-decoration:",colorful:!0},textDecorationStyle:{matches:"^t(?:ext)?:(?:solid|double|dotted|dashed|wavy|$values)(?!\\|)"},textDecorationThickness:{matches:"^text-decoration:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|from-font|$values)[^|]*$",unit:"em"},textDecorationLine:{matches:"^t(?:ext)?:(?:none|underline|overline|line-through|$values)(?!\\|)"},textDecoration:{matches:"^t(?:ext)?:(?:underline|line-through|overline|$values)",colorful:!0,order:-1},textUnderlineOffset:{},textOverflow:{matches:"^(?:text-(?:overflow|ovf):.|t(?:ext)?:(?:ellipsis|clip|$values)(?!\\|))"},textOrientation:{matches:"^t(?:ext)?:(?:mixed|upright|sideways-right|sideways|use-glyph-orientation|$values)(?!\\|)"},textTransform:{matches:"^t(?:ext)?:(?:uppercase|lowercase|capitalize|$values)(?!\\|)"},textRendering:{matches:"^t(?:ext)?:(?:optimizeSpeed|optimizeLegibility|geometricPrecision|$values)(?!\\|)"},textIndent:{},verticalAlign:{matches:"^(?:v|vertical):."},columns:{matches:"^(?:columns|cols):.",unit:"",order:-1},whiteSpace:{unit:""},inset:{matches:"^(?:top|bottom|left|right):.",get(e){return{[this.prefix.slice(0,-1)]:e}}},lines:{matches:"^lines:.",unit:"",prop:!1,get(e){return{overflow:{...e,value:"hidden"},display:{...e,value:"-webkit-box"},"overflow-wrap":{...e,value:"break-word"},"text-overflow":{...e,value:"ellipsis"},"-webkit-box-orient":{...e,value:"vertical"},"-webkit-line-clamp":e}}},maxHeight:{matches:"^max-h:.",values:m.SIZING_VALUES},maxWidth:{matches:"^max-w:.",values:m.SIZING_VALUES},boxSizing:{matches:"^box:(?:$values)(?!\\|)",values:{content:"content-box",border:"border-box"}},opacity:{unit:""},visibility:{},clear:{},float:{},isolation:{},overflow:{matches:"^overflow(?:-x|-y)?:(?:visible|overlay|hidden|scroll|auto|clip|inherit|initial|revert|revert-layer|unset|\\$|var|$values)",prop:!1,get(e){if(this.prefix)switch(this.prefix.slice(-2,-1)){case"x":return{"overflow-x":e};case"y":return{"overflow-y":e}}return{overflow:e}},get order(){return-1}},overscrollBehavior:{matches:"^overscroll-behavior(?:-[xy])?:",prop:!1,get(e){switch(this.prefix.slice(-2,-1)){case"x":return{"overscroll-behavior-x":e};case"y":return{"overscroll-behavior-y":e};default:return{"overscroll-behavior":e}}}},zIndex:{matches:"^z:.",unit:""},position:{values:{abs:"absolute",rel:"relative"}},cursor:{},pointerEvents:{},resize:{},touchAction:{},wordBreak:{unit:""},wordSpacing:{unit:"em"},userDrag:{get(e){return{"user-drag":e,"-webkit-user-drag":e}}},userSelect:{get(e){return{"user-select":e,"-webkit-user-select":e}}},textShadow:{colorful:!0},textSize:{matches:"^t(?:ext)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",prop:!1,get(e){let{unit:t,value:r}=e,s=.75;return{"font-size":e,"line-height":{...e,value:t==="em"?r+s+t:`calc(${r}${t} + ${s}em)`,unit:""}}}},textFillColor:{matches:"^text-fill-color:.",colorStarts:"(?:text-fill|text|t):",colorful:!0,prop:!1,get(e){return{"-webkit-text-fill-color":e}}},textStrokeWidth:{matches:"^text-stroke(:(thin|medium|thick|\\.?[0-9]+|$values)(?!\\|)|-width:.)",prop:!1,get(e){return{"-webkit-text-stroke-width":e}}},textStrokeColor:{matches:"^text-stroke-color:.",colorStarts:"text-stroke:",colorful:!0,prop:!1,get(e){return{"-webkit-text-stroke-color":e}}},textStroke:{matches:"^text-stroke:.",prop:!1,get(e){return{"-webkit-text-stroke":e}}},boxShadow:{matches:"^s(?:hadow)?:.",colorful:!0},tableLayout:{},transformBox:{matches:"^transform:(?:$values)(?!\\|)",values:{...p.BOX_UNDERNEATH,fill:"fill-box",stroke:"stroke-box",view:"view-box"}},transformStyle:{matches:"^transform:(?:flat|preserve-3d|$values)(?!\\|)"},transformOrigin:{matches:"^transform:(?:top|bottom|right|left|center|[0-9]|$values)",unit:"px"},transform:{matches:"^(?:translate|scale|skew|rotate|perspective|matrix)(?:3d|[XYZ])?\\(",unit:"",parseValue(e,{rootSize:t}){return e.replace(/(translate|scale|skew|rotate|perspective|matrix)(3d|[XYZ])?\((.*?)\)/g,(r,s,n,u)=>{let l,d;switch(s){case"translate":l="rem";break;case"skew":l="deg";break;case"rotate":n==="3d"&&(d=!0),l="deg";break;default:return r}let g=u.split(",");return r.replace(u,g.map((o,a)=>!d||g.length-1===a?Number.isNaN(+o)?o:o/(l==="rem"?t:1)+l:o).join(","))})}},transitionProperty:{matches:"^~property:."},transitionTimingFunction:{matches:"^~easing:."},transitionDuration:{matches:"^~duration:.",unit:"ms"},transitionDelay:{matches:"^~delay:.",unit:"ms"},transition:{symbol:"~",order:-1},animationDelay:{matches:"^@delay:.",unit:"ms"},animationDirection:{matches:"^@direction:."},animationDuration:{matches:"^@duration:.",unit:"ms"},animationFillMode:{matches:"^@fill-mode:."},animationIterationCount:{matches:"^@iteration-count:.",unit:""},animationName:{matches:"^@name:."},animationPlayState:{matches:"^@play-state:."},animationTimingFunction:{matches:"^@easing:."},animation:{symbol:"@",unit:"",order:-1},borderColor:{matches:"^border(?:-(?:left|right|top|bottom))?-color:.",colorStarts:"b(?:[xytblr]|(?:order(?:-(?:left|right|top|bottom))?))?:",colorful:!0,prop:!1,get(e){return(0,b.getBorderProps)(this.prefix,e,"color")},get order(){return this.prefix==="border-color:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderRadius:{matches:"^(?:r[tblr]?[tblr]?|border(?:-(?:top|bottom)-(?:left|right))?-radius):.",prop:!1,get(e){if(this.prefix){let r="",s=this.prefix.split("-");if(s.length>1)for(let n=1;n<s.length-1;n++)r+=s[n][0];else r=this.prefix.slice(1,-1);switch(r){case"t":return{"border-top-left-radius":e,"border-top-right-radius":e};case"tl":case"lt":return{"border-top-left-radius":e};case"rt":case"tr":return{"border-top-right-radius":e};case"b":return{"border-bottom-left-radius":e,"border-bottom-right-radius":e};case"bl":case"lb":return{"border-bottom-left-radius":e};case"br":case"rb":return{"border-bottom-right-radius":e};case"l":return{"border-top-left-radius":e,"border-bottom-left-radius":e};case"r":return{"border-top-right-radius":e,"border-bottom-right-radius":e};default:return{"border-radius":e}}}let t=this.prefix?.slice(0,-1);return{[["border-top-left-radius","border-top-right-radius","border-bottom-left-radius","border-bottom-right-radius"].includes(t)?t:"border-radius"]:e}},get order(){return this.prefix==="border-radius:"||this.prefix==="r:"?-1:0}},borderStyle:{matches:"^(?:border(?:-(?:left|right|top|bottom))?-style:.|b(?:[xytblr]|order(?:-(?:left|right|top|bottom))?)?:(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|))",prop:!1,get(e){return(0,b.getBorderProps)(this.prefix,e,"style")},get order(){return this.prefix==="border-style:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderWidth:{matches:"^(?:border(?:-(?:left|right|top|bottom))?-width:.|b(?:[xytblr]|order(?:-(?:left|right|top|bottom))?)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$)",prop:!1,get(e){return(0,b.getBorderProps)(this.prefix,e,"width")},get order(){return this.prefix==="border-width:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderCollapse:{matches:"^b(?:order)?:(?:collapse|separate|$values)(?!\\|)"},borderSpacing:{},borderImageOutset:{},borderImageRepeat:{matches:"^border-image:(?:stretch|repeat|round|space|$values)(?!\\|)"},borderImageSlice:{unit:""},borderImageSource:{matches:"^border-image:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)"},borderImageWidth:{matches:"^border-image:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},borderImage:{unit:""},border:{matches:"^b(?:[xytblr]?|order(?:-(?:left|right|top|bottom))?):.",colorful:!0,prop:!1,get(e){return(0,b.getBorderProps)(this.prefix,e)},get order(){return this.prefix==="border:"||this.prefix==="b:"?-2:-1}},backgroundAttachment:{matches:"^(?:bg|background):(?:fixed|local|scroll|$values)(?!\\|)"},backgroundBlendMode:{},backgroundColor:{colorStarts:"(?:bg|background):",unit:"",colorful:!0},backgroundClip:{matches:"^(?:bg|background):(?:text|$values)(?!\\|)",get(e){return{"-webkit-background-clip":e,"background-clip":e}},values:p.BOX_UNDERNEATH},backgroundOrigin:{matches:"^(?:bg|background):(?:$values)(?!\\|)",values:p.BOX_UNDERNEATH},backgroundPosition:{matches:"^(?:bg|background):(?:top|bottom|right|left|center|$values)(?!\\|)",unit:"px"},backgroundRepeat:{matches:"^(?:bg|background):(?:space|round|repeat|no-repeat|repeat-x|repeat-y|$values)(?![|a-zA-Z])"},backgroundSize:{matches:"^(?:bg|background):(?:\\.?\\[0-9]+|auto|cover|contain|$values)(?!\\|)"},backgroundImage:{matches:"^(?:bg|background):(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)",colorful:!0},background:{matches:"^bg:.",colorful:!0,order:-1},mixBlendMode:{matches:"^blend:."},backdropFilter:{matches:"^bd:.",colorful:!0,get(e){return{"backdrop-filter":e,"-webkit-backdrop-filter":e}},parseValue(e,t){return(0,y.parseValueUnit)(e,r=>{switch(r){case"blur":case"drop-shadow":return"rem";case"hue-rotate":return"deg"}return""},t)}},filter:{matches:"^(?:blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\\(",colorful:!0,parseValue(e,t){return(0,y.parseValueUnit)(e,r=>{switch(r){case"blur":case"drop-shadow":return"rem";case"hue-rotate":return"deg"}return""},t)}},fill:{colorStarts:"fill:",colorful:!0},strokeDasharray:{},strokeDashoffset:{},strokeWidth:{matches:"^stroke:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},stroke:{colorful:!0},x:{unit:""},y:{unit:""},cx:{unit:""},cy:{unit:""},rx:{unit:""},ry:{unit:""},gridColumnStart:{matches:"^grid-col-start:.",unit:""},gridColumnEnd:{matches:"^grid-col-end:.",unit:""},gridColumn:{matches:"^grid-col(?:umn)?(?:-span)?:.",unit:"",order:-1,parseValue(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridColumns:{matches:"^grid-cols:.",unit:"",get(e){return{display:{...e,value:"grid"},"grid-template-columns":{...this,value:"repeat("+e.value+",minmax(0,1fr))"}}}},gridRowStart:{unit:""},gridRowEnd:{unit:""},gridRow:{matches:"^grid-row-span:.",unit:"",order:-1,parseValue(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridRows:{unit:"",get(e){return{display:{...e,value:"grid"},"grid-auto-flow":{...e,value:"column"},"grid-template-rows":{...e,value:"repeat("+e.value+",minmax(0,1fr))"}}}},gridAutoColumns:{matches:"^grid-auto-cols:.",values:x.CONTENT_EXTREMA},gridAutoFlow:{matches:"^grid-flow:."},gridAutoRows:{values:x.CONTENT_EXTREMA},gridTemplateAreas:{},gridTemplateColumns:{matches:"^grid-template-cols:.",values:x.CONTENT_EXTREMA},gridTemplateRows:{values:x.CONTENT_EXTREMA},gridTemplate:{order:-1},gridArea:{unit:"",order:-1},grid:{order:-1},gap:{matches:"^gap(?:-x|-y)?:.",order:-1,prop:!1,get(e){switch(this.prefix[4]){case"x":return{"column-gap":e};case"y":return{"row-gap":e};default:return{gap:e}}}},order:{matches:"^o:.",unit:"",values:{first:-999999,last:999999}},breakInside:{},breakBefore:{},breakAfter:{},boxDecorationBreak:{matches:"^box:(?:slice|clone|$values)(?!\\|)",get(e){return{"box-decoration-break":e,"-webkit-box-decoration-break":e}}},aspectRatio:{matches:"^aspect:.",unit:""},columnSpan:{matches:"^col-span:."},alignContent:{matches:"^ac:."},alignItems:{matches:"^ai:."},alignSelf:{matches:"^as:"},justifyContent:{matches:"^jc:."},justifyItems:{matches:"^ji:."},justifySelf:{matches:"^js:."},placeContent:{order:-1},placeItems:{order:-1},placeSelf:{order:-1},listStylePosition:{matches:"^list-style:(?:inside|outside|$values)(?!\\|)"},listStyleType:{matches:"^list-style:(?:disc|decimal|$values)(?!\\|)"},listStyleImage:{matches:"^list-style:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)"},listStyle:{order:-1},outlineColor:{colorStarts:"outline:",colorful:!0},outlineOffset:{},outlineStyle:{matches:"^outline:(?:none|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)"},outlineWidth:{matches:"^outline:(?:\\.?[0-9]|medium|thick|thin|(max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},outline:{order:-1,colorful:!0},accentColor:{colorStarts:"accent:",colorful:!0},appearance:{},caretColor:{colorStarts:"caret:",colorful:!0},scrollBehavior:{},scrollMargin:{matches:"^scroll-m(?:[xytblr]|argin(?:-(?:top|bottom|left|right))?)?:.",prop:!1,get(e){if(this.prefix.slice(-3,-2)==="m")switch(this.prefix.slice(-2,-1)){case"x":return{"scroll-margin-left":e,"scroll-margin-right":e};case"y":return{"scroll-margin-top":e,"scroll-margin-bottom":e};case"l":return{"scroll-margin-left":e};case"r":return{"scroll-margin-right":e};case"t":return{"scroll-margin-top":e};case"b":return{"scroll-margin-bottom":e}}else return{[this.prefix.replace(/-m(?!argin)/,"-margin").slice(0,-1)]:e}},get order(){return this.prefix==="scroll-margin:"||this.prefix==="scroll-m:"?-1:0}},scrollPadding:{matches:"^scroll-p(?:[xytblr]|adding(?:-(?:top|bottom|left|right))?)?:.",prop:!1,get(e){if(this.prefix.slice(-3,-2)==="p")switch(this.prefix.slice(-2,-1)){case"x":return{"scroll-padding-left":e,"scroll-padding-right":e};case"y":return{"scroll-padding-top":e,"scroll-padding-bottom":e};case"l":return{"scroll-padding-left":e};case"r":return{"scroll-padding-right":e};case"t":return{"scroll-padding-top":e};case"b":return{"scroll-padding-bottom":e}}else return{[this.prefix.replace(/-p(?!adding)/,"-padding").slice(0,-1)]:e}},get order(){return this.prefix==="scroll-padding:"||this.prefix==="scroll-p:"?-1:0}},scrollSnapAlign:{matches:"^scroll-snap:(?:start|end|center|$values)"},scrollSnapStop:{matches:"^scroll-snap:(?:normal|always|$values)(?!\\|)"},scrollSnapType:{matches:"^scroll-snap:(?:(?:[xy]|block|inline|both)(?:\\|(?:proximity|mandatory))?|$values)(?!\\|)"},willChange:{},writingMode:{matches:"^writing:."},direction:{},shapeOutside:{matches:"^shape:(?:(?:inset|circle|ellipse|polygon|url|linear-gradient)\\(.*\\)|$values)(?!\\|)",values:{...p.BOX_UNDERNEATH,margin:"margin-box"}},shapeMargin:{matches:"^shape:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},shapeImageThreshold:{unit:""},clipPath:{matches:"^clip:.",values:{...p.BOX_UNDERNEATH,margin:"margin-box",fill:"fill-box",stroke:"stroke-box",view:"view-box"}},quotes:{},maskImage:{get(e){return{"mask-image":e,"-webkit-mask-image":e}}}};0&&(module.exports={rules});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{program as c}from"commander";import w from"path";import{readPackage as S}from"../utils/read-package";import m from"chokidar";import a from"fs";import{defineContent as x}from"../methods/define-content";import t from"@techor/log";c.command("init").description("Create a Master CSS definition file with configuration").allowUnknownOption().option("--jit","With initialization of the just-in-time program").option("-c, --compiler","With compiler options").option("-o, --override","Override the existing definition file").option("--ext <extension>","Definition extension `ts`, `js`, `mjs`").action(function(l){let{ext:e}=l;if(!e)if(a.existsSync("tsconfig.json"))e="ts";else{let{type:d}=S();d==="module"?e="mjs":e="js"}let i=x({...l,ext:e}),n=`master.css.${e}`,s=a.existsSync(w.join(process.cwd(),n));s?s&&l.override?(a.writeFileSync(n,i),t.ok`**${n}** definition file is overridden`):t.x`**${n}** definition file already exists`:(a.writeFileSync(n,i),t.ok`**${n}** definition file is created`)});c.command("build",{isDefault:!0}).allowUnknownOption().option("-w, --watch","Watch file changed and generate CSS rules.").option("-o, --output <path>","Specify your master CSS file output path","master.css").action(async function({watch:l,output:e}){let i=await new(await import("@master/css-compiler")).default().compile(),n=r=>i.insert(r,a.readFileSync(r,{encoding:"utf-8"})),s=()=>a.writeFileSync(e,i.css.text),d=i.sources;if(console.log(""),t`[sources] ${d}`,l){let r=[],p=async()=>{let{include:o,exclude:y,sources:u}=i.options;o?.length&&g(m.watch(o,{ignored:y,ignoreInitial:!0})),u?.length&&g(m.watch(u,{ignoreInitial:!0})),s(),t.tree(i.options)},h=async o=>{n(o),s()},g=o=>{r.push(o.on("add",h).on("change",h))};await p(),console.log(""),t.t`Start watching source changes`,t.tree(i.options);let f=async()=>{await Promise.all(r.map(o=>o.close())),r.length=0,await i.refresh(),await p()};m.watch([i.resolvedConfigPath],{ignoreInitial:!0}).on("add",f).on("change",f).on("unlink",f)}else s()});var{version:j,name:k,description:v}=S(w.join(__dirname,"../../package.json"));c.name(k);c.description(v);c.version(j);c.parse();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{fillColorScale as f}from"../methods/fill-color-scale";var a={black:"#000000",white:"#ffffff",slate:f({5:"#141e2b",10:"#19212d",20:"#262f3e",30:"#323e52",40:"#41516b",50:"#616a84",55:"#6c7693",60:"#959db3",70:"#a3abbf",80:"#d7dae3",95:"#f6f7f8"}),gray:f({5:"#1e1d1f",10:"#212022",20:"#2f2e30",30:"#3e3d40",40:"#504f52",50:"#6b6a6d",55:"#777679",60:"#9e9da0",70:"#abaaae",80:"#dad9db",95:"#f5f4f7"}),brown:f({5:"#271b15",10:"#2b1e18",20:"#3c2b22",30:"#50382c",40:"#694839",50:"#8d604b",55:"#9d6b53",60:"#b79788",70:"#c1a598",80:"#efd5c9",95:"#faf2ef"}),orange:f({5:"#2e1907",10:"#331b07",20:"#47260b",30:"#5d320e",40:"#7a4111",50:"#a15717",55:"#b4611a",60:"#e38739",70:"#e79855",80:"#f7d4b5",95:"#fcf1e7"}),gold:f({5:"#281b00",10:"#2d1e01",20:"#3f2a00",30:"#543800",40:"#6d4900",50:"#906000",55:"#9c6d00",60:"#d09100",70:"#dca000",80:"#fbd67f",95:"#fff3d8"}),yellow:f({5:"#251d00",10:"#282000",20:"#3a2e01",30:"#4b3b00",40:"#624e00",50:"#806700",55:"#8e7200",60:"#be9900",70:"#d0a700",80:"#edda8f",95:"#fff5ca"}),grass:f({5:"#162106",10:"#182406",20:"#223308",30:"#2c4408",40:"#3a570b",50:"#4e750e",60:"#74ae15",70:"#7dbc17",80:"#bfe87c",95:"#ebfad4"}),green:f({5:"#042311",10:"#032611",20:"#023717",30:"#03481f",40:"#025d26",50:"#067b34",55:"#07883a",60:"#09b64d",70:"#0ac553",80:"#80f1a4",95:"#e0fae8"}),beryl:f({5:"#002319",10:"#00271c",20:"#003626",30:"#004732",40:"#005c41",50:"#007954",55:"#00875e",60:"#00b37c",70:"#00c387",80:"#72f0c5",95:"#d6fcef"}),teal:f({5:"#012220",10:"#012624",20:"#003532",30:"#004541",40:"#005a54",50:"#00776f",55:"#00857c",60:"#00b1a5",70:"#00bfb2",80:"#6aeee5",95:"#d4fcf8"}),cyan:f({5:"#00222b",10:"#00252e",20:"#013340",30:"#004457",40:"#00576f",50:"#007391",55:"#0080a1",60:"#00abd7",70:"#00b9e9",80:"#97e6fa",95:"#dff8ff"}),sky:f({5:"#031f34",10:"#032339",20:"#04314e",30:"#044169",40:"#065386",50:"#086eb3",55:"#097ac5",60:"#29a4f5",70:"#4db3f7",80:"#b3e0ff",95:"#eaf6fe"}),blue:f({5:"#07194a",10:"#081c53",20:"#0a2773",30:"#0e3496",40:"#1146b6",50:"#175fe9",55:"#2671ea",60:"#6b9ef1",70:"#81acf3",80:"#c6dbfe",95:"#edf4fe"}),indigo:f({5:"#1f1645",10:"#20174f",20:"#2b1f74",30:"#37289d",40:"#463fb1",50:"#5a5bd5",55:"#6464f1",60:"#9393f5",70:"#a1a5ee",80:"#d5d7fe",95:"#f1f2ff"}),violet:f({5:"#2b0a4e",10:"#2e0b57",20:"#3d1179",30:"#4e169f",40:"#5f2eba",50:"#7949e5",55:"#8755f5",60:"#ac8af8",70:"#b89bf9",80:"#e1d4fe",95:"#f5f1ff"}),purple:f({5:"#2e0c47",10:"#330c4e",20:"#460f6c",30:"#5b1390",40:"#7421b1",50:"#9832e4",55:"#a348e7",60:"#c184ef",70:"#ca96f1",80:"#ead1fe",95:"#f9f0ff"}),fuchsia:f({5:"#39092a",10:"#400932",20:"#560d4a",30:"#6f1165",40:"#8c158a",50:"#b61cbb",55:"#ca1fce",60:"#e66ee9",70:"#ea86ed",80:"#facbfb",95:"#feefff"}),pink:f({5:"#3d0722",10:"#430725",20:"#5d0933",30:"#790d44",40:"#9a1058",50:"#ca1473",55:"#e11681",60:"#f170b4",70:"#f388c0",80:"#fdcde6",95:"#fff0f8"}),crimson:f({5:"#430213",10:"#470314",20:"#62041c",30:"#800524",40:"#9f1036",50:"#ce1a4b",55:"#e8144c",60:"#f37596",70:"#f58ba7",80:"#fdceda",95:"#fff1f4"}),red:f({5:"#450001",10:"#490102",20:"#640304",30:"#800506",40:"#a11012",50:"#d11a1e",55:"#ed0a0e",60:"#f97476",70:"#fa8b8d",80:"#fdcfcf",95:"#fff1f1"})};export{a as colors};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{breakpoints as e}from"./breakpoints";import{colors as r}from"./colors";import{rootSize as s}from"./root-size";import{scope as o}from"./scope";import{selectors as t}from"./selectors";import{semantics as i}from"./semantics";import{themes as n}from"./themes";import{rules as m}from"./rules";import{override as a}from"./override";import{observe as p}from"./observe";import{important as l}from"./important";var v={breakpoints:e,colors:r,rootSize:s,scope:o,selectors:t,semantics:i,themes:n,rules:m,override:a,observe:p,important:l};export{e as breakpoints,r as colors,v as config,l as important,p as observe,a as override,s as rootSize,m as rules,o as scope,t as selectors,i as semantics,n as themes};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{analyzeValueToken as f}from"../utils/analyze-value-token";import{getBorderProps as b}from"../utils/get-border-props";import{parseValueUnit as v}from"../utils/parse-value-unit";import{START_SYMBOL as y}from"../constants/start-symbol";import{BOX_UNDERNEATH as d}from"../constants/box-underneath";import{CONTENT_EXTREMA as x}from"../constants/content-extrema";import{SIZING_VALUES as h}from"../constants/sizing-values";import{cssEscape as S}from"../utils/css-escape";function k(e){if(this.prefix.includes("-"))return{[this.prefix.slice(0,-1)]:e};let t=this.prefix[0]==="m"?"margin":"padding",s=t+"-left",l=t+"-right",u=t+"-top",n=t+"-bottom";switch(this.prefix[1]){case"x":return{[s]:e,[l]:e};case"y":return{[u]:e,[n]:e};case"l":return{[s]:e};case"r":return{[l]:e};case"t":return{[u]:e};case"b":return{[n]:e};default:return{[t]:e}}}var P={group:{matches:"^(?:.+?[*_>~+])?\\{.+?\\}",unit:"",prop:!1,analyzeToken(e,r,t){let s=0;for(;s<e.length&&!(e[s]==="{"&&e[s-1]!=="\\");s++);return[e.slice(0,s),...f(e.slice(s),r,t)]},getThemeProps(e,r){let t={},s=(o,a)=>{let i=a.indexOf(":");if(i!==-1){o in t||(t[o]={});let c=t[o],g=a.slice(0,i);g in c||(c[g]=a.slice(i+1))}},l=o=>{let a=(i,c)=>{let g=c.slice(S(o.className).length).match(/\{(.*)\}/)[1].split(";");for(let w of g)s(i,w)};if(this.theme){let i=o.natives.find(c=>c.theme===this.theme)??o.natives.find(c=>!c.theme);i&&a(this.theme,i.text)}else for(let i of o.natives)a(i.theme,i.text)},u=[],n="",p=()=>{n&&(u.push(n.replace(/ /g,"")),n="")},m=1;(function o(a){for(;m<e.value.length;m++){let i=e.value[m];if(!a){if(i===";"){p();continue}if(i==="}")break}if(n+=i,a===i){if(a==="'"||a==='"'){let c=0;for(let g=n.length-2;n[g]==="\\";g--)c++;if(c%2)continue}break}else i in y&&a!=="'"&&a!=='"'&&(m++,o(y[i]))}})(void 0),p();for(let o of u){let a=r.create(o);if(Array.isArray(a))for(let i of a)l(i);else a?l(a):s(this.theme??"",o)}return t}},variable:{matches:"^\\$[^ (){}A-Z]+:[^ ]",unit:"",prop:!1,get(e){return{["--"+this.prefix.slice(1,-1)]:e}}},fontSize:{matches:"^f(?:ont)?:(?:[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},fontWeight:{matches:"^f(?:ont)?:(?:bolder|$values)(?!\\|)",unit:"",values:{thin:100,extralight:200,light:300,regular:400,medium:500,semibold:600,bold:700,extrabold:800,heavy:900}},fontFamily:{matches:"^f(?:ont)?:(?:$values)(?!\\|)",values:{mono:"ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace",sans:"ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji",serif:"ui-serif,Georgia,Cambria,Times New Roman,Times,serif"}},fontSmoothing:{matches:"^f(?:ont)?:(?:antialiased|subpixel-antialiased|$values)(?!\\|)",unit:"",prop:!1,get(e){let r={};switch(e.value){case"subpixel-antialiased":r["-webkit-font-smoothing"]=r["-moz-osx-font-smoothing"]={...e,value:"auto"};break;case"antialiased":r["-webkit-font-smoothing"]={...e,value:"antialiased"},r["-moz-osx-font-smoothing"]={...e,value:"grayscale"};break}return r}},fontStyle:{matches:"^f(?:ont)?:(?:normal|italic|oblique|$values)(?!\\|)",unit:"deg"},fontVariantNumeric:{matches:"^f(?:ont)?:(?:ordinal|slashed-zero|lining-nums|oldstyle-nums|proportional-nums|tabular-nums|diagonal-fractions|stacked-fractions|$values)(?!\\|)"},fontFeatureSettings:{matches:"^font-feature:."},font:{matches:"^f:.",unit:"",order:-1},color:{matches:"^(?:color|fg|foreground):.",colorful:!0,unit:""},margin:{matches:"^m(?:argin(?:-(?:left|right|top|bottom))?|[xytblr]?):.",prop:!1,get:k,get order(){return this.prefix==="margin:"||this.prefix==="m:"?-1:0}},padding:{matches:"^p(?:adding(?:-(?:left|right|top|bottom))?|[xytblr]?):.",prop:!1,get:k,get order(){return this.prefix==="padding:"||this.prefix==="p:"?-1:0}},flexBasis:{values:h},flexWrap:{matches:"^flex:(?:wrap(?:-reverse)?|nowrap|$values)(?!\\|)"},flexGrow:{unit:""},flexShrink:{unit:""},flexDirection:{matches:"^flex:(?:(?:row|column)(?:-reverse)?|$values)(?!\\|)",values:{col:"column","col-reverse":"column-reverse"}},flex:{unit:"",order:-1},display:{matches:"^d:."},width:{matches:"^w:.",values:h},height:{matches:"^h:.",values:h},minWidth:{matches:"^min-w:.",values:h},minHeight:{matches:"^min-h:.",values:h},wH:{matches:"^(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",prop:!1,analyzeToken(e,r,t){return["",...f(e,r,t,["x"])]},get(e){let[r,t]=e.value.split(" x ");return{width:{...e,value:r},height:{...e,value:t}}}},minWH:{matches:"^min:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",prop:!1,analyzeToken(e,r,t){return["",...f(e.slice(4),r,t,["x"])]},get(e){let[r,t]=e.value.split(" x ");return{"min-width":{...e,value:r},"min-height":{...e,value:t}}}},maxWH:{matches:"^max:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",prop:!1,analyzeToken(e,r,t){return["",...f(e.slice(4),r,t,["x"])]},get(e){let[r,t]=e.value.split(" x ");return{"max-width":{...e,value:r},"max-height":{...e,value:t}}}},contain:{},content:{},counterIncrement:{unit:""},counterReset:{unit:""},letterSpacing:{matches:"^ls:.",unit:"em"},lineHeight:{matches:"^lh:.",unit:""},objectFit:{matches:"^(?:object|obj):(?:contain|cover|fill|scale-down|$values)"},objectPosition:{matches:"^(?:object|obj):(?:top|bottom|right|left|center|$values)"},textAlign:{matches:"^t(?:ext)?:(?:justify|center|left|right|start|end|$values)(?!\\|)"},textDecorationColor:{colorStarts:"text-decoration:",colorful:!0},textDecorationStyle:{matches:"^t(?:ext)?:(?:solid|double|dotted|dashed|wavy|$values)(?!\\|)"},textDecorationThickness:{matches:"^text-decoration:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|from-font|$values)[^|]*$",unit:"em"},textDecorationLine:{matches:"^t(?:ext)?:(?:none|underline|overline|line-through|$values)(?!\\|)"},textDecoration:{matches:"^t(?:ext)?:(?:underline|line-through|overline|$values)",colorful:!0,order:-1},textUnderlineOffset:{},textOverflow:{matches:"^(?:text-(?:overflow|ovf):.|t(?:ext)?:(?:ellipsis|clip|$values)(?!\\|))"},textOrientation:{matches:"^t(?:ext)?:(?:mixed|upright|sideways-right|sideways|use-glyph-orientation|$values)(?!\\|)"},textTransform:{matches:"^t(?:ext)?:(?:uppercase|lowercase|capitalize|$values)(?!\\|)"},textRendering:{matches:"^t(?:ext)?:(?:optimizeSpeed|optimizeLegibility|geometricPrecision|$values)(?!\\|)"},textIndent:{},verticalAlign:{matches:"^(?:v|vertical):."},columns:{matches:"^(?:columns|cols):.",unit:"",order:-1},whiteSpace:{unit:""},inset:{matches:"^(?:top|bottom|left|right):.",get(e){return{[this.prefix.slice(0,-1)]:e}}},lines:{matches:"^lines:.",unit:"",prop:!1,get(e){return{overflow:{...e,value:"hidden"},display:{...e,value:"-webkit-box"},"overflow-wrap":{...e,value:"break-word"},"text-overflow":{...e,value:"ellipsis"},"-webkit-box-orient":{...e,value:"vertical"},"-webkit-line-clamp":e}}},maxHeight:{matches:"^max-h:.",values:h},maxWidth:{matches:"^max-w:.",values:h},boxSizing:{matches:"^box:(?:$values)(?!\\|)",values:{content:"content-box",border:"border-box"}},opacity:{unit:""},visibility:{},clear:{},float:{},isolation:{},overflow:{matches:"^overflow(?:-x|-y)?:(?:visible|overlay|hidden|scroll|auto|clip|inherit|initial|revert|revert-layer|unset|\\$|var|$values)",prop:!1,get(e){if(this.prefix)switch(this.prefix.slice(-2,-1)){case"x":return{"overflow-x":e};case"y":return{"overflow-y":e}}return{overflow:e}},get order(){return-1}},overscrollBehavior:{matches:"^overscroll-behavior(?:-[xy])?:",prop:!1,get(e){switch(this.prefix.slice(-2,-1)){case"x":return{"overscroll-behavior-x":e};case"y":return{"overscroll-behavior-y":e};default:return{"overscroll-behavior":e}}}},zIndex:{matches:"^z:.",unit:""},position:{values:{abs:"absolute",rel:"relative"}},cursor:{},pointerEvents:{},resize:{},touchAction:{},wordBreak:{unit:""},wordSpacing:{unit:"em"},userDrag:{get(e){return{"user-drag":e,"-webkit-user-drag":e}}},userSelect:{get(e){return{"user-select":e,"-webkit-user-select":e}}},textShadow:{colorful:!0},textSize:{matches:"^t(?:ext)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",prop:!1,get(e){let{unit:r,value:t}=e,s=.75;return{"font-size":e,"line-height":{...e,value:r==="em"?t+s+r:`calc(${t}${r} + ${s}em)`,unit:""}}}},textFillColor:{matches:"^text-fill-color:.",colorStarts:"(?:text-fill|text|t):",colorful:!0,prop:!1,get(e){return{"-webkit-text-fill-color":e}}},textStrokeWidth:{matches:"^text-stroke(:(thin|medium|thick|\\.?[0-9]+|$values)(?!\\|)|-width:.)",prop:!1,get(e){return{"-webkit-text-stroke-width":e}}},textStrokeColor:{matches:"^text-stroke-color:.",colorStarts:"text-stroke:",colorful:!0,prop:!1,get(e){return{"-webkit-text-stroke-color":e}}},textStroke:{matches:"^text-stroke:.",prop:!1,get(e){return{"-webkit-text-stroke":e}}},boxShadow:{matches:"^s(?:hadow)?:.",colorful:!0},tableLayout:{},transformBox:{matches:"^transform:(?:$values)(?!\\|)",values:{...d,fill:"fill-box",stroke:"stroke-box",view:"view-box"}},transformStyle:{matches:"^transform:(?:flat|preserve-3d|$values)(?!\\|)"},transformOrigin:{matches:"^transform:(?:top|bottom|right|left|center|[0-9]|$values)",unit:"px"},transform:{matches:"^(?:translate|scale|skew|rotate|perspective|matrix)(?:3d|[XYZ])?\\(",unit:"",parseValue(e,{rootSize:r}){return e.replace(/(translate|scale|skew|rotate|perspective|matrix)(3d|[XYZ])?\((.*?)\)/g,(t,s,l,u)=>{let n,p;switch(s){case"translate":n="rem";break;case"skew":n="deg";break;case"rotate":l==="3d"&&(p=!0),n="deg";break;default:return t}let m=u.split(",");return t.replace(u,m.map((o,a)=>!p||m.length-1===a?Number.isNaN(+o)?o:o/(n==="rem"?r:1)+n:o).join(","))})}},transitionProperty:{matches:"^~property:."},transitionTimingFunction:{matches:"^~easing:."},transitionDuration:{matches:"^~duration:.",unit:"ms"},transitionDelay:{matches:"^~delay:.",unit:"ms"},transition:{symbol:"~",order:-1},animationDelay:{matches:"^@delay:.",unit:"ms"},animationDirection:{matches:"^@direction:."},animationDuration:{matches:"^@duration:.",unit:"ms"},animationFillMode:{matches:"^@fill-mode:."},animationIterationCount:{matches:"^@iteration-count:.",unit:""},animationName:{matches:"^@name:."},animationPlayState:{matches:"^@play-state:."},animationTimingFunction:{matches:"^@easing:."},animation:{symbol:"@",unit:"",order:-1},borderColor:{matches:"^border(?:-(?:left|right|top|bottom))?-color:.",colorStarts:"b(?:[xytblr]|(?:order(?:-(?:left|right|top|bottom))?))?:",colorful:!0,prop:!1,get(e){return b(this.prefix,e,"color")},get order(){return this.prefix==="border-color:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderRadius:{matches:"^(?:r[tblr]?[tblr]?|border(?:-(?:top|bottom)-(?:left|right))?-radius):.",prop:!1,get(e){if(this.prefix){let t="",s=this.prefix.split("-");if(s.length>1)for(let l=1;l<s.length-1;l++)t+=s[l][0];else t=this.prefix.slice(1,-1);switch(t){case"t":return{"border-top-left-radius":e,"border-top-right-radius":e};case"tl":case"lt":return{"border-top-left-radius":e};case"rt":case"tr":return{"border-top-right-radius":e};case"b":return{"border-bottom-left-radius":e,"border-bottom-right-radius":e};case"bl":case"lb":return{"border-bottom-left-radius":e};case"br":case"rb":return{"border-bottom-right-radius":e};case"l":return{"border-top-left-radius":e,"border-bottom-left-radius":e};case"r":return{"border-top-right-radius":e,"border-bottom-right-radius":e};default:return{"border-radius":e}}}let r=this.prefix?.slice(0,-1);return{[["border-top-left-radius","border-top-right-radius","border-bottom-left-radius","border-bottom-right-radius"].includes(r)?r:"border-radius"]:e}},get order(){return this.prefix==="border-radius:"||this.prefix==="r:"?-1:0}},borderStyle:{matches:"^(?:border(?:-(?:left|right|top|bottom))?-style:.|b(?:[xytblr]|order(?:-(?:left|right|top|bottom))?)?:(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|))",prop:!1,get(e){return b(this.prefix,e,"style")},get order(){return this.prefix==="border-style:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderWidth:{matches:"^(?:border(?:-(?:left|right|top|bottom))?-width:.|b(?:[xytblr]|order(?:-(?:left|right|top|bottom))?)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$)",prop:!1,get(e){return b(this.prefix,e,"width")},get order(){return this.prefix==="border-width:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderCollapse:{matches:"^b(?:order)?:(?:collapse|separate|$values)(?!\\|)"},borderSpacing:{},borderImageOutset:{},borderImageRepeat:{matches:"^border-image:(?:stretch|repeat|round|space|$values)(?!\\|)"},borderImageSlice:{unit:""},borderImageSource:{matches:"^border-image:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)"},borderImageWidth:{matches:"^border-image:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},borderImage:{unit:""},border:{matches:"^b(?:[xytblr]?|order(?:-(?:left|right|top|bottom))?):.",colorful:!0,prop:!1,get(e){return b(this.prefix,e)},get order(){return this.prefix==="border:"||this.prefix==="b:"?-2:-1}},backgroundAttachment:{matches:"^(?:bg|background):(?:fixed|local|scroll|$values)(?!\\|)"},backgroundBlendMode:{},backgroundColor:{colorStarts:"(?:bg|background):",unit:"",colorful:!0},backgroundClip:{matches:"^(?:bg|background):(?:text|$values)(?!\\|)",get(e){return{"-webkit-background-clip":e,"background-clip":e}},values:d},backgroundOrigin:{matches:"^(?:bg|background):(?:$values)(?!\\|)",values:d},backgroundPosition:{matches:"^(?:bg|background):(?:top|bottom|right|left|center|$values)(?!\\|)",unit:"px"},backgroundRepeat:{matches:"^(?:bg|background):(?:space|round|repeat|no-repeat|repeat-x|repeat-y|$values)(?![|a-zA-Z])"},backgroundSize:{matches:"^(?:bg|background):(?:\\.?\\[0-9]+|auto|cover|contain|$values)(?!\\|)"},backgroundImage:{matches:"^(?:bg|background):(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)",colorful:!0},background:{matches:"^bg:.",colorful:!0,order:-1},mixBlendMode:{matches:"^blend:."},backdropFilter:{matches:"^bd:.",colorful:!0,get(e){return{"backdrop-filter":e,"-webkit-backdrop-filter":e}},parseValue(e,r){return v(e,t=>{switch(t){case"blur":case"drop-shadow":return"rem";case"hue-rotate":return"deg"}return""},r)}},filter:{matches:"^(?:blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\\(",colorful:!0,parseValue(e,r){return v(e,t=>{switch(t){case"blur":case"drop-shadow":return"rem";case"hue-rotate":return"deg"}return""},r)}},fill:{colorStarts:"fill:",colorful:!0},strokeDasharray:{},strokeDashoffset:{},strokeWidth:{matches:"^stroke:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},stroke:{colorful:!0},x:{unit:""},y:{unit:""},cx:{unit:""},cy:{unit:""},rx:{unit:""},ry:{unit:""},gridColumnStart:{matches:"^grid-col-start:.",unit:""},gridColumnEnd:{matches:"^grid-col-end:.",unit:""},gridColumn:{matches:"^grid-col(?:umn)?(?:-span)?:.",unit:"",order:-1,parseValue(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridColumns:{matches:"^grid-cols:.",unit:"",get(e){return{display:{...e,value:"grid"},"grid-template-columns":{...this,value:"repeat("+e.value+",minmax(0,1fr))"}}}},gridRowStart:{unit:""},gridRowEnd:{unit:""},gridRow:{matches:"^grid-row-span:.",unit:"",order:-1,parseValue(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridRows:{unit:"",get(e){return{display:{...e,value:"grid"},"grid-auto-flow":{...e,value:"column"},"grid-template-rows":{...e,value:"repeat("+e.value+",minmax(0,1fr))"}}}},gridAutoColumns:{matches:"^grid-auto-cols:.",values:x},gridAutoFlow:{matches:"^grid-flow:."},gridAutoRows:{values:x},gridTemplateAreas:{},gridTemplateColumns:{matches:"^grid-template-cols:.",values:x},gridTemplateRows:{values:x},gridTemplate:{order:-1},gridArea:{unit:"",order:-1},grid:{order:-1},gap:{matches:"^gap(?:-x|-y)?:.",order:-1,prop:!1,get(e){switch(this.prefix[4]){case"x":return{"column-gap":e};case"y":return{"row-gap":e};default:return{gap:e}}}},order:{matches:"^o:.",unit:"",values:{first:-999999,last:999999}},breakInside:{},breakBefore:{},breakAfter:{},boxDecorationBreak:{matches:"^box:(?:slice|clone|$values)(?!\\|)",get(e){return{"box-decoration-break":e,"-webkit-box-decoration-break":e}}},aspectRatio:{matches:"^aspect:.",unit:""},columnSpan:{matches:"^col-span:."},alignContent:{matches:"^ac:."},alignItems:{matches:"^ai:."},alignSelf:{matches:"^as:"},justifyContent:{matches:"^jc:."},justifyItems:{matches:"^ji:."},justifySelf:{matches:"^js:."},placeContent:{order:-1},placeItems:{order:-1},placeSelf:{order:-1},listStylePosition:{matches:"^list-style:(?:inside|outside|$values)(?!\\|)"},listStyleType:{matches:"^list-style:(?:disc|decimal|$values)(?!\\|)"},listStyleImage:{matches:"^list-style:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)"},listStyle:{order:-1},outlineColor:{colorStarts:"outline:",colorful:!0},outlineOffset:{},outlineStyle:{matches:"^outline:(?:none|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)"},outlineWidth:{matches:"^outline:(?:\\.?[0-9]|medium|thick|thin|(max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},outline:{order:-1,colorful:!0},accentColor:{colorStarts:"accent:",colorful:!0},appearance:{},caretColor:{colorStarts:"caret:",colorful:!0},scrollBehavior:{},scrollMargin:{matches:"^scroll-m(?:[xytblr]|argin(?:-(?:top|bottom|left|right))?)?:.",prop:!1,get(e){if(this.prefix.slice(-3,-2)==="m")switch(this.prefix.slice(-2,-1)){case"x":return{"scroll-margin-left":e,"scroll-margin-right":e};case"y":return{"scroll-margin-top":e,"scroll-margin-bottom":e};case"l":return{"scroll-margin-left":e};case"r":return{"scroll-margin-right":e};case"t":return{"scroll-margin-top":e};case"b":return{"scroll-margin-bottom":e}}else return{[this.prefix.replace(/-m(?!argin)/,"-margin").slice(0,-1)]:e}},get order(){return this.prefix==="scroll-margin:"||this.prefix==="scroll-m:"?-1:0}},scrollPadding:{matches:"^scroll-p(?:[xytblr]|adding(?:-(?:top|bottom|left|right))?)?:.",prop:!1,get(e){if(this.prefix.slice(-3,-2)==="p")switch(this.prefix.slice(-2,-1)){case"x":return{"scroll-padding-left":e,"scroll-padding-right":e};case"y":return{"scroll-padding-top":e,"scroll-padding-bottom":e};case"l":return{"scroll-padding-left":e};case"r":return{"scroll-padding-right":e};case"t":return{"scroll-padding-top":e};case"b":return{"scroll-padding-bottom":e}}else return{[this.prefix.replace(/-p(?!adding)/,"-padding").slice(0,-1)]:e}},get order(){return this.prefix==="scroll-padding:"||this.prefix==="scroll-p:"?-1:0}},scrollSnapAlign:{matches:"^scroll-snap:(?:start|end|center|$values)"},scrollSnapStop:{matches:"^scroll-snap:(?:normal|always|$values)(?!\\|)"},scrollSnapType:{matches:"^scroll-snap:(?:(?:[xy]|block|inline|both)(?:\\|(?:proximity|mandatory))?|$values)(?!\\|)"},willChange:{},writingMode:{matches:"^writing:."},direction:{},shapeOutside:{matches:"^shape:(?:(?:inset|circle|ellipse|polygon|url|linear-gradient)\\(.*\\)|$values)(?!\\|)",values:{...d,margin:"margin-box"}},shapeMargin:{matches:"^shape:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},shapeImageThreshold:{unit:""},clipPath:{matches:"^clip:.",values:{...d,margin:"margin-box",fill:"fill-box",stroke:"stroke-box",view:"view-box"}},quotes:{},maskImage:{get(e){return{"mask-image":e,"-webkit-mask-image":e}}}};export{P as rules};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{breakpoints as n}from"../config/breakpoints";var o={full:"100%",fit:"fit-content",max:"max-content",min:"min-content"};for(let t in n)o[t]=n[t]/16+"rem";export{o as SIZING_VALUES};
|
package/dist/esm/css.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var $=Object.defineProperty;var D=(O,e,t)=>e in O?$(O,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):O[e]=t;var S=(O,e,t)=>(D(O,typeof e!="symbol"?e+"":e,t),t);function N(O){let e=typeof Buffer<"u"?Buffer:null;return!!(e&&O instanceof e||O instanceof Date||O instanceof RegExp)}function I(O){if(typeof Buffer<"u"&&Buffer&&O instanceof Buffer){let e=Buffer.alloc(O.length);return O.copy(e),e}else{if(O instanceof Date)return new Date(O.getTime());if(O instanceof RegExp)return new RegExp(O);throw new Error("Unexpected situation")}}function B(O){let e=[];return O.forEach(function(t,s){typeof t=="object"&&t!==null?Array.isArray(t)?e[s]=B(t):N(t)?e[s]=I(t):e[s]=k({},t):e[s]=t}),e}function L(O,e){return e==="__proto__"?void 0:O[e]}function k(...O){let e={},t,s;return O.forEach(function(d){typeof d!="object"||d===null||Array.isArray(d)||Object.keys(d).forEach(function(x){if(s=L(e,x),t=L(d,x),t!==e)if(typeof t!="object"||t===null){e[x]=t;return}else if(Array.isArray(t)){e[x]=B(t);return}else if(N(t)){e[x]=I(t);return}else if(typeof s!="object"||s===null||Array.isArray(s)){e[x]=k({},t);return}else{e[x]=k(s,t);return}})}),e}import{Rule as Q}from"./rule";import{config as F}from"./config";import{rgbToHex as z}from"./utils/rgb-to-hex";import{SELECTOR_SYMBOLS as H}from"./constants/selector-symbols";var A=typeof window<"u",j=class{constructor(e){this.config=e;this.config?.override||(this.config=k(F,e)),this.cache(),A&&this.config.observe&&this.observe(document),j.instances.push(this),this.ready=!0}rules=[];ruleOfClass={};countOfClass={};ready=!1;e=A?new MutationObserver(e=>{let t={},s=[],d=[],x=[],w=(c,n)=>{n?c.classList.forEach(y):c.classList.forEach(g);let l=c.children;for(let m=0;m<l.length;m++){let f=l[m];f.classList&&(d.push(f),w(f,n))}},g=c=>{c in t?t[c]++:t[c]=1},y=c=>{c in t?t[c]--:c in this.countOfClass&&(t[c]=-1)},M=(c,n)=>{for(let l=0;l<c.length;l++){let m=c[l];m.classList&&!d.includes(m)&&!x.includes(m)&&(m.isConnected!==n?(d.push(m),w(m,n)):x.push(m))}};for(let c=0;c<e.length;c++){let n=e[c],{addedNodes:l,removedNodes:m,type:f,target:h}=n;if(f==="attributes"){if(s.find(C=>C.target===h))continue;s.push(n)}else M(l,!1),(!h.isConnected||!d.includes(h))&&M(m,!0)}if(!(!s.length&&!Object.keys(t).length)){for(let{oldValue:c,target:n}of s){let l=d.includes(n),m=n.classList,f=c?c.split(" "):[];if(l){if(n.isConnected)continue;for(let h of f)m.contains(h)||y(h)}else if(n.isConnected){m.forEach(h=>{f.includes(h)||g(h)});for(let h of f)m.contains(h)||y(h)}}for(let c in t){let n=t[c],l=(this.countOfClass[c]||0)+n;l===0?(delete this.countOfClass[c],this.delete(c)):(c in this.countOfClass||this.insert(c),this.countOfClass[c]=l)}}}):null;cache(){this.semantics=[],this.classes={},this.colorThemesMap={},this.relationThemesMap={},this.relations={},this.colorNames=[],this.themeNames=[""],this.selectors={},this.values={},this.globalValues={},this.breakpoints={},this.mediaQueries={},this.matches={};let{semantics:e,classes:t,selectors:s,themes:d,colors:x,values:w,breakpoints:g,mediaQueries:y,rules:M}=this.config;function c(r){return r.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function n(r,o,i="",u={}){let a=R=>R?(i?i+"-":"")+R:i,b=Object.entries(r),p=[],T=[];for(let R of b){let E=R[1];(typeof E=="object"&&!Array.isArray(E)?p:T).push(R)}for(let[R,E]of p)n(E,o,a(R),u);if(o&&i)T.length&&(u[i]=T.reduce((R,[E,V])=>(R[E]=V,R),{}));else for(let[R,E]of T)u[a(R)]=E;return u}if(e)for(let[r,o]of Object.entries(n(e,!0)))this.semantics.push([new RegExp("^"+c(r)+"(?=!|\\*|>|\\+|~|:|\\[|@|_|\\.|$)","m"),[r,o]]);if(s)for(let[r,o]of Object.entries(n(s,!1))){let i=new RegExp(c(r)+"(?![a-z-])");for(let u of Array.isArray(o)?o:[o]){let a=u.match(/^::-[a-z]+-/m)?.[0]??"",b=this.selectors[a];b||(b=this.selectors[a]=[]);let p=b.find(([T])=>T===i);p||(p=[i,[]],b.push(p)),p[1].push(u)}}w&&(this.globalValues=n(w,!1)),g&&(this.breakpoints=n(g,!1)),y&&(this.mediaQueries=n(y,!1));let l=t?n(t,!1):{},m=d&&!Array.isArray(d)?Object.entries(d).filter(([,{classes:r}])=>r).reduce((r,[o,{classes:i}])=>(r[o]=n(i,!1),r),{}):{},f=[...Object.keys(l),...Object.entries(m).flatMap(([r,o])=>Object.keys(o))],h=r=>{if(r in this.classes)return;let o=this.classes[r]=[],i=(u,a)=>{if(!a)return;let b=Array.isArray(a)?a:a.replace(/(?:\n(?:\s*))+/g," ").trim().split(" ");for(let p of b){let T=R=>{R in this.relationThemesMap?u in this.relationThemesMap[R]?this.relationThemesMap[R][u].push(r):this.relationThemesMap[R][u]=[r]:this.relationThemesMap[R]={[u]:[r]},o.includes(R)||o.push(R)};if(f.includes(p)){h(p);for(let R of this.classes[p])T(R)}else T(p)}};i("",l?.[r]);for(let[u,a]of Object.entries(m))i(u,a?.[r])};for(let r of f)h(r);for(let r in this.relationThemesMap){let o=this.relations[r]=[];for(let i of Object.values(this.relationThemesMap[r]))for(let u of i)o.includes(u)||o.push(u)}let C=(r,o)=>{if(!o)return;let i=n(o,!0);for(let[u,a]of Object.entries(i)){let b=typeof a=="string"?{"":a}:a;for(let[p,T]of Object.entries(b)){let R=u+(p?"-"+p:"");R in this.colorThemesMap?this.colorThemesMap[R][r]=T:this.colorThemesMap[R]={[r]:T}}}for(let u in o)this.colorNames.includes(u)||this.colorNames.push(u)};if(C("",x),d)if(Array.isArray(d))this.themeNames.push(...d);else for(let r in d){let o=d[r];C(r,o.colors),this.themeNames.push(r)}let v=r=>{for(let[o,i]of Object.entries(this.colorThemesMap))for(let[u,a]of Object.entries(i))a.startsWith("#")||r(o,i,u,a)};if(v((r,o,i,u)=>{let a=/^rgba?\( *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?:(?:\/|,) *0?(\.[0-9]))?\)$/.exec(u);if(a){let b="#"+z(+a[1],+a[2],+a[3]);a[4]&&(b+=Math.round(255*+a[4]).toString(16)),o[i]=b}}),v((r,o,i,u)=>{let[a,b]=u.split("/"),p=this.colorThemesMap[a];if(p){let T=(i?p[i]:void 0)??p[""];o[i]=b?T.slice(0,7)+Math.round(255*+b).toString(16):T}else console.warn(`\`${u}\` doesn't exist in the extended config \`.colors\``),delete o[i],Object.keys(o).length||delete this.colorThemesMap[r]}),M)for(let r in M){let o=M[r],{matches:i,prop:u,values:a}=o;if(o.id=r,o.prop=u===!1?"":r.replace(/(?!^)[A-Z]/g,b=>"-"+b).toLowerCase(),a&&(this.values[r]=n(a,!1)),i){let b=Object.keys(this.values[r]??{}),p=i.indexOf("$values");this.matches[r]=new RegExp(p===-1?i:b.length?i.slice(0,p)+b.join("|")+i.slice(p+7):i.slice(0,p-(i[p-1]==="|"?1:0))+i.slice(p+7+(i[p+7]==="|"?1:0)))}}}observe(e,t={subtree:!0,childList:!0}){if(A&&e){this.root=e;let s=e===document;s&&(j.root=this),this.host=s?document.documentElement:root.host;let d=s?document.head:e,x=s?document.styleSheets:e.styleSheets;for(let g of x){let{title:y,href:M,ownerNode:c}=g;(y==="master"||M&&M.startsWith(window.location.origin)&&/master(?:\..+)?\.css/.test(M))&&(this.style=c)}if(this.style)for(let g=0;g<this.style.sheet.cssRules.length;g++){let y=c=>{if(c.selectorText){let l=c.selectorText.split(", ")[0].split(" ");for(let m=0;m<l.length;m++){let f=l[m];if(f[0]==="."){let h=f.slice(1),C="";for(let v=0;v<h.length;v++){let r=h[v],o=h[v+1];if(r==="\\"){if(v++,o!=="\\"){C+=o;continue}}else if(H.includes(r))break;C+=r}if(!(C in this.ruleOfClass)&&!(C in this.classes)){let v=this.create(C)[0];if(v)return v}}}}else if(c.cssRules)for(let n=0;n<c.cssRules.length;n++){let l=y(c.cssRules[n]);if(l)return l}},M=y(this.style.sheet.cssRules[g]);if(M){this.rules.push(M),this.ruleOfClass[M.className]=M;for(let c=0;c<M.natives.length;c++)M.natives[c].cssRule=this.style.sheet.cssRules[g+c];g+=M.natives.length-1}}else{this.style=document.createElement("style"),this.style.title="master";let g=d.querySelector('link[rel="styleSheet"], style');g?g.before(this.style):d.append(this.style)}let w=g=>{g.forEach(y=>{y in this.countOfClass?this.countOfClass[y]++:(this.countOfClass[y]=1,this.insert(y))})};w(this.host.classList),t.subtree&&this.host.querySelectorAll("[class]").forEach(g=>w(g.classList)),this.e.observe(e,{...t,attributes:!0,attributeOldValue:!0,attributeFilter:["class"]})}return this}disconnect(){this.e.disconnect(),this.ruleOfClass={},this.countOfClass={},this.rules.length=0;let e=this.style.sheet;if(e)for(let t=e.cssRules.length-1;t>=0;t--)e.deleteRule(t);this.style.remove(),this.style=null}match(e){for(let t in this.config.rules){let s=this.config.rules[t],d=this.matches[t],{colorStarts:x,symbol:w,prop:g}=s,{colorNames:y,colorThemesMap:M}=this;if(d&&d.test(e))return{origin:"matches",config:s};if(x){if(e.match("^"+x+"(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|current|inherit))"))return{origin:"matches",config:s};if(y.length&&e.indexOf("|")===-1){let c=e.match("^"+x+"((?:"+y.join("|")+")[0-9a-zA-Z-]*)");if(c&&c[1]in M)return{origin:"matches",config:s}}}if(w&&e.startsWith(w))return{origin:"symbol",config:s};if(g&&e.startsWith(g+":"))return{origin:"matches",config:s}}for(let t of this.semantics)if(e.match(t[0]))return{origin:"semantics",value:t[1]}}create(e){let t=s=>{if(s in this.ruleOfClass)return this.ruleOfClass[s];let d=this.match(s);if(d)return new Q(s,d,this)};return(e in this.classes?this.classes[e].map(s=>t(s)):[t(e)]).filter(s=>s&&s.text)}refresh(e){if(e?.override?this.config=e:this.config=k(F,e),this.cache(),!this.style)return;let t=document.createElement("style");t.title="master",this.style.replaceWith(t),this.style=t,this.rules.length=0,this.ruleOfClass={};for(let s in this.countOfClass)this.insert(s)}destroy(){let e=j.instances;this.disconnect(),e.splice(e.indexOf(this),1)}delete(e){let t=this.style.sheet,s=d=>{let x=this.ruleOfClass[d];if(!(!x||d in this.relations&&this.relations[d].some(w=>w in this.countOfClass))){if(x.natives.length){let w=x.natives[0];for(let g=0;g<t.cssRules.length;g++)if(t.cssRules[g]===w.cssRule){for(let M=0;M<x.natives.length;M++)t.deleteRule(g);this.rules.splice(this.rules.indexOf(x),1);break}}delete this.ruleOfClass[d]}};if(e in this.classes){for(let d of this.classes[e])d in this.countOfClass||s(d);delete this.ruleOfClass[e]}else s(e)}insert(e){let t=this.create(e);return t.length?(this.insertRules(t),!0):!1}insertRules(e){for(let t of e){if(this.ruleOfClass[t.className])continue;let s,d=this.rules.length-1,{media:x,order:w,priority:g,hasWhere:y,className:M}=t,c=(n,l,m,f)=>{let h=0,C;l&&(h=n.findIndex(l)),m&&(C=n.findIndex(m)),h===-1&&(h=n.length),(C===void 0||C===-1)&&(C=n.length);let v=n.slice(h,C);for(let r=0;r<v.length;r++){let o=v[r];if(!(o.priority===-1||f&&f(o))&&(o.priority<g||o.priority===g&&(y&&!o.hasWhere||o.order>=w)))return h+r}return h+v.length};if(x){let n=this.rules.findIndex(l=>l.media);if(n!==-1){let l=x.features["max-width"],m=x.features["min-width"];if(l&&m){let f=l.value-m.value;for(let h=d;h>=n;h--){s=h;let C=this.rules[h],v=C.media,r=v.features["max-width"],o=v.features["min-width"];if(!r||!o){s++;break}let i=r.value-o.value;if(i===f){if(y!==C.hasWhere)continue;if(g!==-1){let u=[this.rules[h]];for(let a=h-1;a>=n;a--){let b=this.rules[a];if(b.hasWhere!==y)break;let p=b.media,T=p.features["max-width"],R=p.features["min-width"];if(!T||!R||T.value-R.value!==i)break;u.unshift(this.rules[a])}s=c(this.rules,a=>a.media&&a.priority!==-1&&a.media.features["min-width"]&&a.media.features["max-width"])}break}else if(i>f)break}}else if(m)for(let f=n;f<=d;f++){s=f;let h=this.rules[f],C=h.media,v=C.features["max-width"],r=C.features["min-width"];if(v){if(r)break;continue}let o=r?.value;if(o===m.value){if(!y&&h.hasWhere){s++;continue}if(g!==-1)s=c(this.rules,i=>i.media,i=>i.media&&i.priority!==-1&&i.media.features["min-width"]&&i.media.features["max-width"],i=>!i.media.features["min-width"]&&!i.media.features["max-width"]);else for(let i=f;i<=d;i++){let u=this.rules[i],a=u.media,b=a.features["min-width"];if(!a.features["max-width"]){if(u.hasWhere!==y||b.value!==o||u.order>=w)break;s=i+1}}break}else{if(o>m.value)break;s++}}else if(l)for(let f=d;f>=n;f--){s=f;let h=this.rules[f],C=h.media,v=C.features["max-width"];if(C.features["min-width"])continue;let o=v?.value;if(!o||o>l.value){s++;break}else if(o===l.value){if(y&&!h.hasWhere)continue;if(g!==-1)s=c(this.rules,i=>i.media,i=>i.media&&i.priority!==-1&&i.media.features["min-width"]&&i.media.features["max-width"],i=>!i.media.features["min-width"]&&!i.media.features["max-width"]);else{let i=[this.rules[f]];for(let u=f-1;u>=n;u--){let a=this.rules[u],b=a.media,p=b.features["min-width"],T=b.features["max-width"];if(!p&&(!T||T.value!==o||a.hasWhere!==y))break;i.unshift(a)}for(let u=0;u<i.length;u++){let a=i[u];if(!a.media.features["min-width"]){if(a.order>=w)break;s=f-i.length+2+u}}}break}}}if(s===void 0)if(n===-1)s=d+1;else if(g!==-1)s=n+c(this.rules.slice(n),void 0,l=>l.media.features["max-width"]||l.media.features["min-width"]);else if(y){let l=n;for(;l<this.rules.length;l++){let m=this.rules[l];if(m.priority!==-1||!m.hasWhere||m.order>=w){s=l;break}}s===void 0&&(s=l)}else for(let l=n;l<=d;l++){s=l;let m=this.rules[l],f=m.media;if(m.priority!==-1||f.features["max-width"]||f.features["min-width"])break;if(m.hasWhere)s++;else if(m.order>=w)break}}else if(g===-1)if(y)s=this.rules.findIndex(n=>!n.hasWhere||n.media||n.priority!==-1||n.order>=w),s===-1&&(s=d+1);else{let n=0;for(;n<this.rules.length;n++){let l=this.rules[n];if(l.media||!l.hasWhere&&(l.order>=w||l.priority!==-1)){s=n;break}}s===void 0&&(s=n)}else s=c(this.rules,void 0,n=>n.media);if(this.rules.splice(s,0,t),this.ruleOfClass[M]=t,this.style){let n=this.style.sheet,l=0,m=f=>{let h=this.rules[f];if(h){if(!h.natives.length)return m(f-1);let C=h.natives[h.natives.length-1].cssRule;for(let v=0;v<n.cssRules.length;v++)if(n.cssRules[v]===C){l=v+1;break}}};m(s-1);for(let f=0;f<t.natives.length;)try{let h=t.natives[f];n.insertRule(h.text,l),h.cssRule=n.cssRules[l++],f++}catch(h){console.error(h),t.natives.splice(f,1)}}}}get text(){return this.rules.map(e=>e.text).join("")}},W=j;S(W,"root"),S(W,"config",F),S(W,"instances",[]),S(W,"refresh",e=>{for(let t of j.instances)t.refresh(e)});A&&(window.MasterCSS=W);export{W as MasterCSS};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{MasterCSS as e}from"./css";import{Theme as a}from"./theme";new e(window.masterCSSConfig);new a(window.masterCSSThemeSettings);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"./css";export*from"./rule";export*from"./theme";import{MasterCSS as E}from"./css";function a(t){let e=typeof Buffer<"u"?Buffer:null;return!!(e&&t instanceof e||t instanceof Date||t instanceof RegExp)}function l(t){if(typeof Buffer<"u"&&Buffer&&t instanceof Buffer){let e=Buffer.alloc(t.length);return t.copy(e),e}else{if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return new RegExp(t);throw new Error("Unexpected situation")}}function c(t){let e=[];return t.forEach(function(r,n){typeof r=="object"&&r!==null?Array.isArray(r)?e[n]=c(r):a(r)?e[n]=l(r):e[n]=u({},r):e[n]=r}),e}function i(t,e){return e==="__proto__"?void 0:t[e]}function u(...t){let e={},r,n;return t.forEach(function(o){typeof o!="object"||o===null||Array.isArray(o)||Object.keys(o).forEach(function(f){if(n=i(e,f),r=i(o,f),r!==e)if(typeof r!="object"||r===null){e[f]=r;return}else if(Array.isArray(r)){e[f]=c(r);return}else if(a(r)){e[f]=l(r);return}else if(typeof n!="object"||n===null||Array.isArray(n)){e[f]=u({},r);return}else{e[f]=u(n,r);return}})}),e}export*from"./methods";export*from"./config";export{E as default,u as extend};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{hexToRgb as s}from"../utils/hex-to-rgb";import{rgbToHex as L}from"../utils/rgb-to-hex";function x(e){typeof e=="string"&&(e={"":e});let h=""in e,t=!1;for(let o in e)if(o&&+o>=100){t=!0;break}if(!t&&(!h||Object.keys(e).length>1)){let o=0,i="0"in e?s(e[0]):[0,0,0],c,r,l=[],b=()=>{let n=c-o,v=r.map((f,g)=>(f-i[g])/n);for(let f of l){let g=f-o,p=i.map((m,u)=>Math.round(m+v[u]*g));e[f]="#"+L.call(this,...p)}};for(let n=1;n<100;n++)n in e?(l.length?(c=n,r=s(e[n]),b(),l.length=0,i=r):i=s(e[n]),o=n):l.push(n);l.length&&(c=100,r="100"in e?s(e[100]):[255,255,255],b())}return h||(e[""]=e[t?"500":"50"]),e}export{x as fillColorScale};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"./render";export*from"./render-from-html";export*from"./render-into-html";export*from"./fill-color-scale";export*from"./define-content";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{MasterCSS as c}from"../css";function a(r,n){if(!r)return;let e=new c({...n,observe:!1}),o=/\sclass="([^"]*)"/gm,t;for(;t=o.exec(r);){let i=t[1].replace(/\n/g,"").split(" ").filter(s=>s);for(let s of i)s in e.countOfClass||(e.insert(s),e.countOfClass[s]=1)}return e.text}export{a as renderFromHTML};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{renderFromHTML as t}from"./render-from-html";function i(e,r){if(e)return e.replace(/(<link[^>]*?rel="styleSheet".*?>|<style.*?>|<\/head>)/,`<style title="master">${t(e,r)}</style>$1`)}export{i as renderIntoHTML};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{MasterCSS as e}from"../css";function i(r,o){if(!r?.length)return;let n=new e({...o,observe:!1});for(let t of r)t in n.countOfClass||n.insert(t)&&(n.countOfClass[t]=1);return n.text}export{i as render};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getCssPropertyText as N}from"./utils/get-css-property-text";import{analyzeValueToken as ie}from"./utils/analyze-value-token";import{parseRuleValue as E}from"./utils/parse-rule-value";import{SORTED_SELECTORS as G}from"./constants/sorted-selectors";import{cssEscape as se}from"./utils/css-escape";var H=class{constructor(y,v,b){this.className=y;this.meta=v;this.css=b;let{id:J,unit:K="rem",order:X=0,colorful:x,prop:Y,analyzeToken:z,getThemeProps:T,parseValue:D,get:F}=v.config||{},{rootSize:Z,scope:P,important:j}=b.config,{themeNames:_,colorNames:$,colorThemesMap:ee,selectors:O,globalValues:Q,breakpoints:q,mediaQueries:M}=b,I=b.values[J],U=b.relationThemesMap[y],h=y;this.order=X;let A,C,m,S;if(v.origin==="semantics"){let[l,r]=v.value;m=h.slice(l.length),A=r}else if(z)[C,S,m]=z.call(this,h,I,Q);else{let l;if(v.origin==="matches"){let r=h.indexOf(":");this.prefix=h.slice(0,r+1),this.prefix.includes("(")?(this.prefix=void 0,l=h):l=h.slice(r+1)}else v.origin==="symbol"&&(this.symbol=h[0],l=h.slice(1));[S,m]=ie(l,I,Q)}m[0]==="!"&&(this.important=!0,m=m.slice(1));let B=l=>{let r=l.split(/(\\'(?:.*?)[^\\]\\')(?=[*_>~+,)])|(\[[^=]+='(?:.*?)[^\\]'\])/).map((t,i)=>i%3?t:t.replace(/_/g," ")).join(""),s=[],o="",u=0;for(let t=0;t<r.length;t++){let i=r[t];if(i==="\\"){o+=i+r[++t];continue}!u&&i===","?(s.push(o),o=""):(o+=i,u&&i===")"?u--:i==="("&&u++)}return o&&s.push(o),s};this.prefixSelectors=C?B(C):[""];let w=m.split("@"),V=w[0];if(V){this.vendorSuffixSelectors={};let l=(t,i,e,n)=>{for(let[a,f]of i)if(a.test(t)){for(let g of f)l(t.replace(a,g),i,e,!0);return}n&&e.push(t)},r=[];""in O?l(V,O[""],r,!0):r.push(V);let s={};for(let[t,i]of Object.entries(O)){if(!t)continue;let e=[];for(let n of r)l(n,i,e,!1);e.length&&(s[t]=e)}let o=(t,i)=>{let e=i.reduce((n,a)=>(n.push(...B(a)),n),[]);t in this.vendorSuffixSelectors?this.vendorSuffixSelectors[t].push(...e):this.vendorSuffixSelectors[t]=e},u=Object.keys(s);if(u.length)for(let t of u)o(t,s[t]);else o("",r);for(let t of Object.values(this.vendorSuffixSelectors))for(let i of t){this.hasWhere!==!1&&(this.hasWhere=i.includes(":where("));for(let e=0;e<G.length;e++)if(i.includes(G[e])){(this.priority===-1||this.priority>e)&&(this.priority=e);break}}}else this.vendorSuffixSelectors={"":[""]};for(let l=1;l<w.length;l++){let r=w[l];if(r)if(_.includes(r))this.theme=r;else if(r==="rtl"||r==="ltr")this.direction=r;else{let s,o,u=r.indexOf("_");if(u!==-1)s=r.slice(0,u),o=r.slice(u);else{let t=r.indexOf("(");t!==-1&&(s=r.slice(0,t),o=r.slice(t))}if(!s){s="media";let t=[];this.media={token:r,features:{}};let i=r.split("&");for(let e of i)if(e==="all"||e==="print"||e==="screen"||e==="speech")this.media.type=e;else if(e==="\u{1F5A8}")this.media.type="print";else if(e==="landscape"||e==="portrait")t.push("(orientation:"+e+")");else if(e==="motion"||e==="reduced-motion")t.push("(prefers-reduced-motion:"+(e==="motion"?"no-preference":"reduce")+")");else if(M&&e in M)t.push(M[e]);else{let n={token:e},a="",f="",g=0;e.startsWith("<=")?(f="<=",a="max-width"):e.startsWith(">=")||q[e]?(f=">=",a="min-width"):e.startsWith(">")?(f=">",a="min-width",g=.02):e.startsWith("<")&&(f="<",a="max-width",g=-.02);let p=f?e.replace(f,""):e,c=q[p];switch(a){case"max-width":case"min-width":c?Object.assign(n,E(c,"px")):Object.assign(n,E(p,"px")),n.unit==="px"&&(n.value+=g),this.media.features[a]=n,t.push("("+a+":"+(n.value+n.unit)+")");break}}o="",this.media.type&&(o=this.media.type),t.length&&(o+=(o?" and ":"")+t.join(" and "))}o&&(this.at[s]=(s in this.at?this.at[s]+" and ":"")+o.replace(/_/g," "))}}let k=(l,r)=>{let s,o,u=(i,e,n)=>{let a="";this.direction&&(a+="[dir="+this.direction+"] ");let f=this.prefixSelectors.map(c=>c+a),g=(c,R)=>f.map(d=>(c?"."+c+" ":"")+(P?P+" ":"")+d).reduce((d,W)=>(d.push(n.reduce((L,te)=>(L.push(W+"."+se(R)+te),L),[]).join(",")),d),[]).join(","),p=g(e,y)+(U?Object.entries(U).filter(([c])=>this.theme||!x||!e||!c||c===e).map(([c,R])=>R.reduce((d,W)=>d+","+g(this.theme??((x||T)&&e||c),W),"")).join(""):"")+"{"+i+"}";for(let c of Object.keys(this.at).sort((R,d)=>d==="supports"?-1:1))p="@"+c+" "+this.at[c]+"{"+p+"}";return p},t=[];if(S){let i,e;for(let n of S)typeof n=="string"?t.push(n):(i=E(n.value,K,x&&$,x&&ee,Z,this.theme?[this.theme,""]:[l]),i.colorMatched!==void 0&&e!==!0&&(e=i.colorMatched),t.push(i.value+i.unit));if(r&&(e===void 0?l:!e))return;if(t.length===1?i?(s=i.value,o=i.unit):s=t[0]:s=t.reduce((n,a,f)=>n+a+(a===","||S[f+1]===","||f===S.length-1?"":" "),""),typeof s!="object"){D&&(s=D.call(this,s,this.css.config)),x&&s==="current"&&(s="currentColor");let n={unit:o,value:s,important:this.important};if(T){let a=T.call(this,n,b);for(let f in a)for(let g of Object.values(this.vendorSuffixSelectors))this.natives.push({unit:o,value:s,text:u(Object.entries(a[f]).map(([p,c])=>N(p,{important:(this.important||j)&&!c.endsWith("!important"),unit:"",value:c})).join(";"),f,g),theme:f});return}else F&&(s=F.call(this,n))}}else s=A;for(let i of Object.values(this.vendorSuffixSelectors))this.natives.push({unit:o,value:s,text:u(typeof s=="object"?Object.entries(s).map(([e,n])=>N(e,{...typeof n=="object"?n:{unit:"",value:n},important:this.important||j})).join(";"):N(Y,{unit:o,value:s,important:this.important||j}),l,i),theme:l})};if(T)k(void 0,!1);else if(this.theme)k(this.theme,!1);else if(x)for(let l of _)k(l,!0);else k("",!1)}at={};priority=-1;natives=[];get text(){return this.natives.map(y=>y.text).join("")}};export{H as Rule};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{START_SYMBOL as a}from"../constants/start-symbol";function R(x,h,S,b=[]){let A=[",",...b],f=[],n="",e=0;return function p(r,t,g,l="",o=[],d=[]){let u,c=!1;t&&(t===")"&&n.slice(-1)==="$"?u=n.length-1:(t==="'"||t==='"')&&(c=!0),n+=r[e++]);let m=()=>{let i=n;if(n="",h&&i in h&&!o.includes(i)){let s=e;e=0,p(h[i].toString(),void 0,void 0,void 0,[...o,i],d),e=s}else if(S&&i in S&&!d.includes(i)){let s=e;e=0,p(S[i].toString(),void 0,void 0,void 0,o,[...d,i]),e=s}else f.push({value:i})};for(;e<r.length;e++){let i=r[e];if(i===t){if(n+=i,c){let s=0;for(let y=n.length-2;n[y]==="\\";y--)s++;if(s%2)continue}u!==void 0&&(n=n.slice(0,u)+n.slice(u).replace(/\$\((.*)\)/,"var(--$1)")),g||(c?f.push(n):m(),l="",n="");break}else if(!c&&i in a)p(r,a[i],g===void 0?0:g+1,l,o,d);else if((i==="|"||i===" ")&&t!=="}"&&(!c||l==="path"))t?n+=" ":m();else{if(!t){if(i==="."){if(isNaN(+r[e+1]))break;r[e-1]==="-"&&(n+="0")}else if(A.includes(i)){n&&m(),f.push(i);continue}else if(i==="#"&&(n||f.length&&r[e-1]!=="|"&&f[e-1]!==" ")||["!","*",">","+","~",":","[","@","_"].includes(i))break;l+=i}n+=i}}g===void 0&&n&&m()}(x),[f,x.slice(e)]}export{R as analyzeValueToken};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getType as e}from"./get-type";function n(t){return e(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}export{n as isPlainObject};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getType as y}from"./get-type";function r(o){return y(o)==="Symbol"}export{r as isSymbol};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{analyzeUnitValue as k}from"./analyze-unit-value";function p(a,c,g){let u=t=>t==="+"||t==="-"||t==="*"||t==="/",s="",n,i="",o=!1,l=!1;function r(t,e="",b=""){if(n===2&&!l){let f=k(i,c,g);f&&(i=f.value+f.unit)}s+=i+e+t+b,n=null,l=!1,i=""}for(let t=0;t<a.length;t++){let e=a[t];if(e==="("||e===")")o=e===")",r(e);else if(e===",")r(e,""," ");else{switch(n){case 1:break;case 2:if(u(e)){r(e," "," ");continue}else/[0-9]/.test(e)||(l=!0);break;default:o&&(s+=" "),isNaN(+e)?u(e)||(n=1):n=2;break}n?i+=e:s+=e}}return i&&(s+=i),s}export{p as normalizeCssCalcText};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{analyzeUnitValue as C}from"./analyze-unit-value";import{normalizeCssCalcText as R}from"./normalize-css-calc-text";function w(e,n,p,s,o,d){let l="",u="",f;if(typeof e=="number")l=e,u=n||"";else{if(s){let g=!1,m=!1;e=e.replace(new RegExp(`(^|,| |\\()((?:${p.join("|")})(?:-(?:[0-9A-Za-z-]+))?)(?:\\/(\\.?[0-9]+%?))?(?=(\\)|\\}|,| |$))`,"gm"),(b,M,x,r)=>{m=!0;let h=s[x];if(h){let i;for(let a of d)if(i=h[a])break;if(i){g=!0;let a=i;if(r){let t=r.endsWith("%")?parseFloat(r)/100:+r;t=isNaN(t)?1:Math.min(Math.max(t,0),1),a+=Math.round(t*255).toString(16).toUpperCase().padStart(2,"0")}return M+a}}return b}),m&&(f=g)}let c=C(e,o,n);if(c)return c;l=(e.indexOf("calc(")===-1?e:R(e,o,n)).replace(/\$\(((\w|-)+)\)/g,"var(--$1)")}return{value:l,unit:u,colorMatched:f}}export{w as parseRuleValue};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a(i,g,{rootSize:c}){let n="",r=0;return function o(l,u){let t="",s=u?g(u):"",f=()=>{t&&(n+=!s||Number.isNaN(+t)?t:+t/(s==="rem"?c:1)+s,t="")};for(;r<i.length;r++){let e=i[r];if(e===l&&(l!=="'"||i[r+1]===")")){f(),n+=e;break}else e===","||e===" "?(f(),n+=e):!t&&e==="'"?(n+=e,r++,o(e),t=""):t&&e==="("?(n+=t+e,r++,o(")",t),t=""):t+=e}f()}(),n}export{a as parseValueUnit};
|