@master/css 2.0.0-beta.121 → 2.0.0-beta.123
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/README.md +7 -7
- package/dist/cjs/config/index.js +1 -1
- package/dist/cjs/config/rules.js +1 -1
- package/dist/cjs/css.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/methods/index.js +1 -1
- package/dist/config/index.d.ts +1 -245
- package/dist/css.d.ts +1 -0
- package/dist/esm/bin/index.js +1 -1
- package/dist/esm/config/colors.js +1 -1
- package/dist/esm/config/index.js +1 -1
- package/dist/esm/config/rules.js +1 -1
- package/dist/esm/constants/sizing-values.js +1 -1
- package/dist/esm/css.js +1 -1
- package/dist/esm/index.browser.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/methods/fill-color-scale.js +1 -1
- package/dist/esm/methods/index.js +1 -1
- package/dist/esm/methods/render-from-html.js +1 -1
- package/dist/esm/methods/render-into-html.js +1 -1
- package/dist/esm/methods/render.js +1 -1
- package/dist/esm/rule.js +1 -1
- package/dist/esm/theme.js +1 -1
- package/dist/esm/utils/analyze-value-token.js +1 -1
- package/dist/esm/utils/is-plain-object.js +1 -1
- package/dist/esm/utils/is-symbol.js +1 -1
- package/dist/esm/utils/normalize-css-calc-text.js +1 -1
- package/dist/esm/utils/parse-rule-value.js +1 -1
- package/dist/esm/utils/parse-value-unit.js +1 -1
- package/dist/index.browser.js +1 -1
- package/dist/index.js +25 -0
- package/dist/index.mjs +25 -0
- package/dist/methods/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/cjs/index.node.js +0 -1
- package/dist/esm/index.node.js +0 -1
- package/dist/index.node.d.ts +0 -2
package/README.md
CHANGED
|
@@ -60,18 +60,18 @@
|
|
|
60
60
|
</div>
|
|
61
61
|
|
|
62
62
|
## Documentation
|
|
63
|
-
Visit [
|
|
63
|
+
Visit [beta.css.master.co](https://beta.css.master.co) to view the full documentation
|
|
64
64
|
|
|
65
65
|
## Getting Started
|
|
66
|
-
Check out the [
|
|
66
|
+
Check out the [official guides](https://beta.css.master.co/docs) to get started with Master CSS, or walk through the [examples](https://github.com/master-co/css/tree/beta/examples) for a quick overview of integrating with your framework.
|
|
67
67
|
|
|
68
68
|
## Compilation Modes
|
|
69
|
-
Master CSS provides
|
|
69
|
+
Master CSS provides various [compilation modes](https://beta.css.master.co/docs/compilation)](https://beta.css.master.co/docs/compilation), allowing you to choose according to the characteristics and needs of different projects.
|
|
70
70
|
|
|
71
|
-
- [
|
|
72
|
-
- [🚧 Ahead-of-time](https://beta.css.master.co/docs/compilation/ahead-of-time) -
|
|
73
|
-
- [🚧
|
|
74
|
-
- [🚧 Progressive Rendering](https://beta.css.master.co/docs/compilation/progressive-rendering) -
|
|
71
|
+
- [Just-in-time](https://beta.css.master.co/docs/compilation/just-in-time) - Observe the DOM tree, manipulate CSS rules according to the changed class name, and synchronize to the running style sheet at runtime
|
|
72
|
+
- [🚧 Ahead-of-time](https://beta.css.master.co/docs/compilation/ahead-of-time) - Scan source files for class names at build time, extract class names, and generate CSS files/virtual modules, then import them in the entry file
|
|
73
|
+
- [🚧 Hybrid Rendering](https://beta.css.master.co/docs/compilation/hybrid-rendering) - Mix just-in-time and ahead-of-time compilation modes and enjoy the advantages and conveniences of both without a server
|
|
74
|
+
- [🚧 Progressive Rendering](https://beta.css.master.co/docs/compilation/progressive-rendering) - Scan the requested HTML on the server side, generate CSS rules, and enable just-in-time compilation on the browser side
|
|
75
75
|
|
|
76
76
|
## Ecosystem
|
|
77
77
|
We've built various integrations and tools around Master CSS:
|
package/dist/cjs/config/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var t=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var h=(r,e)=>{for(var o in e)t(r,o,{get:e[o],enumerable:!0})},B=(r,e,o,
|
|
1
|
+
var t=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var h=(r,e)=>{for(var o in e)t(r,o,{get:e[o],enumerable:!0})},B=(r,e,o,k)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of S(e))!d.call(r,s)&&s!==o&&t(r,s,{get:()=>e[s],enumerable:!(k=b(e,s))||k.enumerable});return r};var v=r=>B(t({},"__esModule",{value:!0}),r);var R={};h(R,{breakpoints:()=>i.breakpoints,colors:()=>m.colors,config:()=>Q,important:()=>C.important,observe:()=>u.observe,override:()=>y.override,rootSize:()=>n.rootSize,rules:()=>f.rules,scope:()=>p.scope,selectors:()=>a.selectors,semantics:()=>l.semantics,theme:()=>c.theme,themes:()=>g.themes});module.exports=v(R);var i=require("./breakpoints"),m=require("./colors"),n=require("./root-size"),p=require("./scope"),a=require("./selectors"),l=require("./semantics"),g=require("./themes"),c=require("./theme"),f=require("./rules"),y=require("./override"),u=require("./observe"),C=require("./important"),Q={breakpoints:i.breakpoints,colors:m.colors,rootSize:n.rootSize,scope:p.scope,selectors:a.selectors,semantics:l.semantics,themes:g.themes,theme:c.theme,rules:f.rules,override:y.override,observe:u.observe,important:C.important};0&&(module.exports={breakpoints,colors,config,important,observe,override,rootSize,rules,scope,selectors,semantics,theme,themes});
|
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"),j=require("../polyfills/css-escape"),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+","+1+"fr))"}}}},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+","+1+"fr))"}}}},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 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"),j=require("../polyfills/css-escape"),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});
|
package/dist/cjs/css.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var S=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var Z=Object.prototype.hasOwnProperty;var P=(y,e,t)=>e in y?S(y,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):y[e]=t;var U=(y,e)=>{for(var t in e)S(y,t,{get:e[t],enumerable:!0})},Y=(y,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of q(e))!Z.call(y,a)&&a!==t&&S(y,a,{get:()=>e[a],enumerable:!(s=_(e,a))||s.enumerable});return y};var G=y=>Y(S({},"__esModule",{value:!0}),y);var A=(y,e,t)=>(P(y,typeof e!="symbol"?e+"":e,t),t);var J={};U(J,{MasterCSS:()=>W});module.exports=G(J);function I(y){let e=typeof Buffer<"u"?Buffer:null;return!!(e&&y instanceof e||y instanceof Date||y instanceof RegExp)}function B(y){if(typeof Buffer<"u"&&Buffer&&y instanceof Buffer){let e=Buffer.alloc(y.length);return y.copy(e),e}else{if(y instanceof Date)return new Date(y.getTime());if(y instanceof RegExp)return new RegExp(y);throw new Error("Unexpected situation")}}function V(y){let e=[];return y.forEach(function(t,s){typeof t=="object"&&t!==null?Array.isArray(t)?e[s]=V(t):I(t)?e[s]=B(t):e[s]=k({},t):e[s]=t}),e}function N(y,e){return e==="__proto__"?void 0:y[e]}function k(...y){let e={},t,s;return y.forEach(function(a){typeof a!="object"||a===null||Array.isArray(a)||Object.keys(a).forEach(function(C){if(s=N(e,C),t=N(a,C),t!==e)if(typeof t!="object"||t===null){e[C]=t;return}else if(Array.isArray(t)){e[C]=V(t);return}else if(I(t)){e[C]=B(t);return}else if(typeof s!="object"||s===null||Array.isArray(s)){e[C]=k({},t);return}else{e[C]=k(s,t);return}})}),e}var $=require("./rule"),L=require("./config"),D=require("./theme"),H=require("./utils/rgb-to-hex"),Q=require("./constants/selector-symbols");var F=typeof window<"u",j=class{constructor(e){this.config=e;this.config?.override||(this.config=k(L.config,e)),this.cache(),F&&this.config.observe&&this.observe(document),j.instances.push(this),this.ready=!0}rules=[];ruleOfClass={};countOfClass={};ready=!1;e=F?new MutationObserver(e=>{let t={},s=[],a=[],C=[],w=(c,n)=>{n?c.classList.forEach(b):c.classList.forEach(g);let l=c.children;for(let m=0;m<l.length;m++){let u=l[m];u.classList&&(a.push(u),w(u,n))}},g=c=>{c in t?t[c]++:t[c]=1},b=c=>{c in t?t[c]--:c in this.countOfClass&&(t[c]=-1)},O=(c,n)=>{for(let l=0;l<c.length;l++){let m=c[l];m.classList&&!a.includes(m)&&!C.includes(m)&&(m.isConnected!==n?(a.push(m),w(m,n)):C.push(m))}};for(let c=0;c<e.length;c++){let n=e[c],{addedNodes:l,removedNodes:m,type:u,target:f}=n;if(u==="attributes"){if(s.find(v=>v.target===f))continue;s.push(n)}else O(l,!1),(!f.isConnected||!a.includes(f))&&O(m,!0)}if(!(!s.length&&!Object.keys(t).length)){for(let{oldValue:c,target:n}of s){let l=a.includes(n),m=n.classList,u=c?c.split(" "):[];if(l){if(n.isConnected)continue;for(let f of u)m.contains(f)||b(f)}else if(n.isConnected){m.forEach(f=>{u.includes(f)||g(f)});for(let f of u)m.contains(f)||b(f)}}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:a,colors:C,values:w,breakpoints:g,mediaQueries:b,rules:O}=this.config;function c(r){return r.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function n(r,o,i="",d={}){let h=x=>x?(i?i+"-":"")+x:i,R=Object.entries(r),p=[],T=[];for(let x of R){let E=x[1];(typeof E=="object"&&!Array.isArray(E)?p:T).push(x)}for(let[x,E]of p)n(E,o,h(x),d);if(o&&i)T.length&&(d[i]=T.reduce((x,[E,z])=>(x[E]=z,x),{}));else for(let[x,E]of T)d[h(x)]=E;return d}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 d of Array.isArray(o)?o:[o]){let h=d.match(/^::-[a-z]+-/m)?.[0]??"",R=this.selectors[h];R||(R=this.selectors[h]=[]);let p=R.find(([T])=>T===i);p||(p=[i,[]],R.push(p)),p[1].push(d)}}w&&(this.globalValues=n(w,!1)),g&&(this.breakpoints=n(g,!1)),b&&(this.mediaQueries=n(b,!1));let l=t?n(t,!1):{},m=a&&!Array.isArray(a)?Object.entries(a).filter(([,{classes:r}])=>r).reduce((r,[o,{classes:i}])=>(r[o]=n(i,!1),r),{}):{},u=[...Object.keys(l),...Object.entries(m).flatMap(([r,o])=>Object.keys(o))],f=r=>{if(r in this.classes)return;let o=this.classes[r]=[],i=(d,h)=>{if(!h)return;let R=Array.isArray(h)?h:h.replace(/(?:\n(?:\s*))+/g," ").trim().split(" ");for(let p of R){let T=x=>{x in this.relationThemesMap?d in this.relationThemesMap[x]?this.relationThemesMap[x][d].push(r):this.relationThemesMap[x][d]=[r]:this.relationThemesMap[x]={[d]:[r]},o.includes(x)||o.push(x)};if(u.includes(p)){f(p);for(let x of this.classes[p])T(x)}else T(p)}};i("",l?.[r]);for(let[d,h]of Object.entries(m))i(d,h?.[r])};for(let r of u)f(r);for(let r in this.relationThemesMap){let o=this.relations[r]=[];for(let i of Object.values(this.relationThemesMap[r]))for(let d of i)o.includes(d)||o.push(d)}let v=(r,o)=>{if(!o)return;let i=n(o,!0);for(let[d,h]of Object.entries(i)){let R=typeof h=="string"?{"":h}:h;for(let[p,T]of Object.entries(R)){let x=d+(p?"-"+p:"");x in this.colorThemesMap?this.colorThemesMap[x][r]=T:this.colorThemesMap[x]={[r]:T}}}for(let d in o)this.colorNames.includes(d)||this.colorNames.push(d)};if(v("",C),a)if(Array.isArray(a))this.themeNames.push(...a);else for(let r in a){let o=a[r];v(r,o.colors),this.themeNames.push(r)}let M=r=>{for(let[o,i]of Object.entries(this.colorThemesMap))for(let[d,h]of Object.entries(i))h.startsWith("#")||r(o,i,d,h)};if(M((r,o,i,d)=>{let h=/^rgba?\( *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?:(?:\/|,) *0?(\.[0-9]))?\)$/.exec(d);if(h){let R="#"+(0,H.rgbToHex)(+h[1],+h[2],+h[3]);h[4]&&(R+=Math.round(255*+h[4]).toString(16)),o[i]=R}}),M((r,o,i,d)=>{let[h,R]=d.split("/"),p=this.colorThemesMap[h];if(p){let T=(i?p[i]:void 0)??p[""];o[i]=R?T.slice(0,7)+Math.round(255*+R).toString(16):T}else console.warn(`\`${d}\` doesn't exist in the extended config \`.colors\``),delete o[i],Object.keys(o).length||delete this.colorThemesMap[r]}),O)for(let r in O){let o=O[r],{matches:i,prop:d,values:h}=o;if(o.id=r,o.prop=d===!1?"":r.replace(/(?!^)[A-Z]/g,R=>"-"+R).toLowerCase(),h&&(this.values[r]=n(h,!1)),i){let R=Object.keys(this.values[r]??{}),p=i.indexOf("$values");this.matches[r]=new RegExp(p===-1?i:R.length?i.slice(0,p)+R.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(F&&e){this.root=e;let s=e===document;s&&(j.root=this),this.host=s?document.documentElement:root.host,this.theme=new D.Theme(this.host,this.config.theme);let a=s?document.head:e,C=s?document.styleSheets:e.styleSheets;for(let g of C){let{title:b,href:O,ownerNode:c}=g;(b==="master"||O&&O.startsWith(window.location.origin)&&/master(?:\..+)?\.css/.test(O))&&(this.style=c)}if(this.style)for(let g=0;g<this.style.sheet.cssRules.length;g++){let b=c=>{if(c.selectorText){let l=c.selectorText.split(", ")[0].split(" ");for(let m=0;m<l.length;m++){let u=l[m];if(u[0]==="."){let f=u.slice(1),v="";for(let M=0;M<f.length;M++){let r=f[M],o=f[M+1];if(r==="\\"){if(M++,o!=="\\"){v+=o;continue}}else if(Q.SELECTOR_SYMBOLS.includes(r))break;v+=r}if(!(v in this.ruleOfClass)&&!(v in this.classes)){let M=this.create(v)[0];if(M)return M}}}}else if(c.cssRules)for(let n=0;n<c.cssRules.length;n++){let l=b(c.cssRules[n]);if(l)return l}},O=b(this.style.sheet.cssRules[g]);if(O){this.rules.push(O),this.ruleOfClass[O.className]=O;for(let c=0;c<O.natives.length;c++)O.natives[c].cssRule=this.style.sheet.cssRules[g+c];g+=O.natives.length-1}}else{this.style=document.createElement("style"),this.style.title="master";let g=a.querySelector('link[rel="styleSheet"], style');g?g.before(this.style):a.append(this.style)}let w=g=>{g.forEach(b=>{b in this.countOfClass?this.countOfClass[b]++:(this.countOfClass[b]=1,this.insert(b))})};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,this.theme?.destroy(),this.theme=null}match(e){for(let t in this.config.rules){let s=this.config.rules[t],a=this.matches[t],{colorStarts:C,symbol:w,prop:g}=s,{colorNames:b,colorThemesMap:O}=this;if(a&&a.test(e))return{origin:"matches",config:s};if(C){if(e.match("^"+C+"(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|current|inherit))"))return{origin:"matches",config:s};if(b.length&&e.indexOf("|")===-1){let c=e.match("^"+C+"((?:"+b.join("|")+")[0-9a-zA-Z-]*)");if(c&&c[1]in O)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 a=this.match(s);if(a)return new $.Rule(s,a,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(L.config,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=a=>{let C=this.ruleOfClass[a];if(!(!C||a in this.relations&&this.relations[a].some(w=>w in this.countOfClass))){if(C.natives.length){let w=C.natives[0];for(let g=0;g<t.cssRules.length;g++)if(t.cssRules[g]===w.cssRule){for(let O=0;O<C.natives.length;O++)t.deleteRule(g);this.rules.splice(this.rules.indexOf(C),1);break}}delete this.ruleOfClass[a]}};if(e in this.classes){for(let a of this.classes[e])a in this.countOfClass||s(a);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,a=this.rules.length-1,{media:C,order:w,priority:g,hasWhere:b,className:O}=t,c=(n,l,m,u)=>{let f=0,v;l&&(f=n.findIndex(l)),m&&(v=n.findIndex(m)),f===-1&&(f=n.length),(v===void 0||v===-1)&&(v=n.length);let M=n.slice(f,v);for(let r=0;r<M.length;r++){let o=M[r];if(!(o.priority===-1||u&&u(o))&&(o.priority<g||o.priority===g&&(b&&!o.hasWhere||o.order>=w)))return f+r}return f+M.length};if(C){let n=this.rules.findIndex(l=>l.media);if(n!==-1){let l=C.features["max-width"],m=C.features["min-width"];if(l&&m){let u=l.value-m.value;for(let f=a;f>=n;f--){s=f;let v=this.rules[f],M=v.media,r=M.features["max-width"],o=M.features["min-width"];if(!r||!o){s++;break}let i=r.value-o.value;if(i===u){if(b!==v.hasWhere)continue;if(g!==-1){let d=[this.rules[f]];for(let h=f-1;h>=n;h--){let R=this.rules[h];if(R.hasWhere!==b)break;let p=R.media,T=p.features["max-width"],x=p.features["min-width"];if(!T||!x||T.value-x.value!==i)break;d.unshift(this.rules[h])}s=c(this.rules,h=>h.media&&h.priority!==-1&&h.media.features["min-width"]&&h.media.features["max-width"])}break}else if(i>u)break}}else if(m)for(let u=n;u<=a;u++){s=u;let f=this.rules[u],v=f.media,M=v.features["max-width"],r=v.features["min-width"];if(M){if(r)break;continue}let o=r?.value;if(o===m.value){if(!b&&f.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=u;i<=a;i++){let d=this.rules[i],h=d.media,R=h.features["min-width"];if(!h.features["max-width"]){if(d.hasWhere!==b||R.value!==o||d.order>=w)break;s=i+1}}break}else{if(o>m.value)break;s++}}else if(l)for(let u=a;u>=n;u--){s=u;let f=this.rules[u],v=f.media,M=v.features["max-width"];if(v.features["min-width"])continue;let o=M?.value;if(!o||o>l.value){s++;break}else if(o===l.value){if(b&&!f.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[u]];for(let d=u-1;d>=n;d--){let h=this.rules[d],R=h.media,p=R.features["min-width"],T=R.features["max-width"];if(!p&&(!T||T.value!==o||h.hasWhere!==b))break;i.unshift(h)}for(let d=0;d<i.length;d++){let h=i[d];if(!h.media.features["min-width"]){if(h.order>=w)break;s=u-i.length+2+d}}}break}}}if(s===void 0)if(n===-1)s=a+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(b){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<=a;l++){s=l;let m=this.rules[l],u=m.media;if(m.priority!==-1||u.features["max-width"]||u.features["min-width"])break;if(m.hasWhere)s++;else if(m.order>=w)break}}else if(g===-1)if(b)s=this.rules.findIndex(n=>!n.hasWhere||n.media||n.priority!==-1||n.order>=w),s===-1&&(s=a+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[O]=t,this.style){let n=this.style.sheet,l=0,m=u=>{let f=this.rules[u];if(f){if(!f.natives.length)return m(u-1);let v=f.natives[f.natives.length-1].cssRule;for(let M=0;M<n.cssRules.length;M++)if(n.cssRules[M]===v){l=M+1;break}}};m(s-1);for(let u=0;u<t.natives.length;)try{let f=t.natives[u];n.insertRule(f.text,l),f.cssRule=n.cssRules[l++],u++}catch(f){console.error(f),t.natives.splice(u,1)}}}}get text(){return this.rules.map(e=>e.text).join("")}},W=j;A(W,"root"),A(W,"instances",[]),A(W,"refresh",e=>{for(let t of j.instances)t.refresh(e)});F&&(window.MasterCSS=W);0&&(module.exports={MasterCSS});
|
|
1
|
+
var A=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var Z=Object.prototype.hasOwnProperty;var P=(y,e,t)=>e in y?A(y,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):y[e]=t;var U=(y,e)=>{for(var t in e)A(y,t,{get:e[t],enumerable:!0})},Y=(y,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of q(e))!Z.call(y,a)&&a!==t&&A(y,a,{get:()=>e[a],enumerable:!(s=_(e,a))||s.enumerable});return y};var G=y=>Y(A({},"__esModule",{value:!0}),y);var S=(y,e,t)=>(P(y,typeof e!="symbol"?e+"":e,t),t);var J={};U(J,{MasterCSS:()=>W});module.exports=G(J);function I(y){let e=typeof Buffer<"u"?Buffer:null;return!!(e&&y instanceof e||y instanceof Date||y instanceof RegExp)}function B(y){if(typeof Buffer<"u"&&Buffer&&y instanceof Buffer){let e=Buffer.alloc(y.length);return y.copy(e),e}else{if(y instanceof Date)return new Date(y.getTime());if(y instanceof RegExp)return new RegExp(y);throw new Error("Unexpected situation")}}function V(y){let e=[];return y.forEach(function(t,s){typeof t=="object"&&t!==null?Array.isArray(t)?e[s]=V(t):I(t)?e[s]=B(t):e[s]=k({},t):e[s]=t}),e}function N(y,e){return e==="__proto__"?void 0:y[e]}function k(...y){let e={},t,s;return y.forEach(function(a){typeof a!="object"||a===null||Array.isArray(a)||Object.keys(a).forEach(function(C){if(s=N(e,C),t=N(a,C),t!==e)if(typeof t!="object"||t===null){e[C]=t;return}else if(Array.isArray(t)){e[C]=V(t);return}else if(I(t)){e[C]=B(t);return}else if(typeof s!="object"||s===null||Array.isArray(s)){e[C]=k({},t);return}else{e[C]=k(s,t);return}})}),e}var $=require("./rule"),F=require("./config"),D=require("./theme"),H=require("./utils/rgb-to-hex"),Q=require("./constants/selector-symbols");var L=typeof window<"u",j=class{constructor(e){this.config=e;this.config?.override||(this.config=k(F.config,e)),this.cache(),L&&this.config.observe&&this.observe(document),j.instances.push(this),this.ready=!0}rules=[];ruleOfClass={};countOfClass={};ready=!1;e=L?new MutationObserver(e=>{let t={},s=[],a=[],C=[],w=(c,n)=>{n?c.classList.forEach(b):c.classList.forEach(g);let l=c.children;for(let m=0;m<l.length;m++){let u=l[m];u.classList&&(a.push(u),w(u,n))}},g=c=>{c in t?t[c]++:t[c]=1},b=c=>{c in t?t[c]--:c in this.countOfClass&&(t[c]=-1)},O=(c,n)=>{for(let l=0;l<c.length;l++){let m=c[l];m.classList&&!a.includes(m)&&!C.includes(m)&&(m.isConnected!==n?(a.push(m),w(m,n)):C.push(m))}};for(let c=0;c<e.length;c++){let n=e[c],{addedNodes:l,removedNodes:m,type:u,target:f}=n;if(u==="attributes"){if(s.find(v=>v.target===f))continue;s.push(n)}else O(l,!1),(!f.isConnected||!a.includes(f))&&O(m,!0)}if(!(!s.length&&!Object.keys(t).length)){for(let{oldValue:c,target:n}of s){let l=a.includes(n),m=n.classList,u=c?c.split(" "):[];if(l){if(n.isConnected)continue;for(let f of u)m.contains(f)||b(f)}else if(n.isConnected){m.forEach(f=>{u.includes(f)||g(f)});for(let f of u)m.contains(f)||b(f)}}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:a,colors:C,values:w,breakpoints:g,mediaQueries:b,rules:O}=this.config;function c(r){return r.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function n(r,o,i="",d={}){let h=x=>x?(i?i+"-":"")+x:i,R=Object.entries(r),p=[],T=[];for(let x of R){let E=x[1];(typeof E=="object"&&!Array.isArray(E)?p:T).push(x)}for(let[x,E]of p)n(E,o,h(x),d);if(o&&i)T.length&&(d[i]=T.reduce((x,[E,z])=>(x[E]=z,x),{}));else for(let[x,E]of T)d[h(x)]=E;return d}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 d of Array.isArray(o)?o:[o]){let h=d.match(/^::-[a-z]+-/m)?.[0]??"",R=this.selectors[h];R||(R=this.selectors[h]=[]);let p=R.find(([T])=>T===i);p||(p=[i,[]],R.push(p)),p[1].push(d)}}w&&(this.globalValues=n(w,!1)),g&&(this.breakpoints=n(g,!1)),b&&(this.mediaQueries=n(b,!1));let l=t?n(t,!1):{},m=a&&!Array.isArray(a)?Object.entries(a).filter(([,{classes:r}])=>r).reduce((r,[o,{classes:i}])=>(r[o]=n(i,!1),r),{}):{},u=[...Object.keys(l),...Object.entries(m).flatMap(([r,o])=>Object.keys(o))],f=r=>{if(r in this.classes)return;let o=this.classes[r]=[],i=(d,h)=>{if(!h)return;let R=Array.isArray(h)?h:h.replace(/(?:\n(?:\s*))+/g," ").trim().split(" ");for(let p of R){let T=x=>{x in this.relationThemesMap?d in this.relationThemesMap[x]?this.relationThemesMap[x][d].push(r):this.relationThemesMap[x][d]=[r]:this.relationThemesMap[x]={[d]:[r]},o.includes(x)||o.push(x)};if(u.includes(p)){f(p);for(let x of this.classes[p])T(x)}else T(p)}};i("",l?.[r]);for(let[d,h]of Object.entries(m))i(d,h?.[r])};for(let r of u)f(r);for(let r in this.relationThemesMap){let o=this.relations[r]=[];for(let i of Object.values(this.relationThemesMap[r]))for(let d of i)o.includes(d)||o.push(d)}let v=(r,o)=>{if(!o)return;let i=n(o,!0);for(let[d,h]of Object.entries(i)){let R=typeof h=="string"?{"":h}:h;for(let[p,T]of Object.entries(R)){let x=d+(p?"-"+p:"");x in this.colorThemesMap?this.colorThemesMap[x][r]=T:this.colorThemesMap[x]={[r]:T}}}for(let d in o)this.colorNames.includes(d)||this.colorNames.push(d)};if(v("",C),a)if(Array.isArray(a))this.themeNames.push(...a);else for(let r in a){let o=a[r];v(r,o.colors),this.themeNames.push(r)}let M=r=>{for(let[o,i]of Object.entries(this.colorThemesMap))for(let[d,h]of Object.entries(i))h.startsWith("#")||r(o,i,d,h)};if(M((r,o,i,d)=>{let h=/^rgba?\( *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?:(?:\/|,) *0?(\.[0-9]))?\)$/.exec(d);if(h){let R="#"+(0,H.rgbToHex)(+h[1],+h[2],+h[3]);h[4]&&(R+=Math.round(255*+h[4]).toString(16)),o[i]=R}}),M((r,o,i,d)=>{let[h,R]=d.split("/"),p=this.colorThemesMap[h];if(p){let T=(i?p[i]:void 0)??p[""];o[i]=R?T.slice(0,7)+Math.round(255*+R).toString(16):T}else console.warn(`\`${d}\` doesn't exist in the extended config \`.colors\``),delete o[i],Object.keys(o).length||delete this.colorThemesMap[r]}),O)for(let r in O){let o=O[r],{matches:i,prop:d,values:h}=o;if(o.id=r,o.prop=d===!1?"":r.replace(/(?!^)[A-Z]/g,R=>"-"+R).toLowerCase(),h&&(this.values[r]=n(h,!1)),i){let R=Object.keys(this.values[r]??{}),p=i.indexOf("$values");this.matches[r]=new RegExp(p===-1?i:R.length?i.slice(0,p)+R.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(L&&e){this.root=e;let s=e===document;s&&(j.root=this),this.host=s?document.documentElement:root.host,this.theme=new D.Theme(this.host,this.config.theme);let a=s?document.head:e,C=s?document.styleSheets:e.styleSheets;for(let g of C){let{title:b,href:O,ownerNode:c}=g;(b==="master"||O&&O.startsWith(window.location.origin)&&/master(?:\..+)?\.css/.test(O))&&(this.style=c)}if(this.style)for(let g=0;g<this.style.sheet.cssRules.length;g++){let b=c=>{if(c.selectorText){let l=c.selectorText.split(", ")[0].split(" ");for(let m=0;m<l.length;m++){let u=l[m];if(u[0]==="."){let f=u.slice(1),v="";for(let M=0;M<f.length;M++){let r=f[M],o=f[M+1];if(r==="\\"){if(M++,o!=="\\"){v+=o;continue}}else if(Q.SELECTOR_SYMBOLS.includes(r))break;v+=r}if(!(v in this.ruleOfClass)&&!(v in this.classes)){let M=this.create(v)[0];if(M)return M}}}}else if(c.cssRules)for(let n=0;n<c.cssRules.length;n++){let l=b(c.cssRules[n]);if(l)return l}},O=b(this.style.sheet.cssRules[g]);if(O){this.rules.push(O),this.ruleOfClass[O.className]=O;for(let c=0;c<O.natives.length;c++)O.natives[c].cssRule=this.style.sheet.cssRules[g+c];g+=O.natives.length-1}}else{this.style=document.createElement("style"),this.style.title="master";let g=a.querySelector('link[rel="styleSheet"], style');g?g.before(this.style):a.append(this.style)}let w=g=>{g.forEach(b=>{b in this.countOfClass?this.countOfClass[b]++:(this.countOfClass[b]=1,this.insert(b))})};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,this.theme?.destroy(),this.theme=null}match(e){for(let t in this.config.rules){let s=this.config.rules[t],a=this.matches[t],{colorStarts:C,symbol:w,prop:g}=s,{colorNames:b,colorThemesMap:O}=this;if(a&&a.test(e))return{origin:"matches",config:s};if(C){if(e.match("^"+C+"(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|current|inherit))"))return{origin:"matches",config:s};if(b.length&&e.indexOf("|")===-1){let c=e.match("^"+C+"((?:"+b.join("|")+")[0-9a-zA-Z-]*)");if(c&&c[1]in O)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 a=this.match(s);if(a)return new $.Rule(s,a,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.config,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=a=>{let C=this.ruleOfClass[a];if(!(!C||a in this.relations&&this.relations[a].some(w=>w in this.countOfClass))){if(C.natives.length){let w=C.natives[0];for(let g=0;g<t.cssRules.length;g++)if(t.cssRules[g]===w.cssRule){for(let O=0;O<C.natives.length;O++)t.deleteRule(g);this.rules.splice(this.rules.indexOf(C),1);break}}delete this.ruleOfClass[a]}};if(e in this.classes){for(let a of this.classes[e])a in this.countOfClass||s(a);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,a=this.rules.length-1,{media:C,order:w,priority:g,hasWhere:b,className:O}=t,c=(n,l,m,u)=>{let f=0,v;l&&(f=n.findIndex(l)),m&&(v=n.findIndex(m)),f===-1&&(f=n.length),(v===void 0||v===-1)&&(v=n.length);let M=n.slice(f,v);for(let r=0;r<M.length;r++){let o=M[r];if(!(o.priority===-1||u&&u(o))&&(o.priority<g||o.priority===g&&(b&&!o.hasWhere||o.order>=w)))return f+r}return f+M.length};if(C){let n=this.rules.findIndex(l=>l.media);if(n!==-1){let l=C.features["max-width"],m=C.features["min-width"];if(l&&m){let u=l.value-m.value;for(let f=a;f>=n;f--){s=f;let v=this.rules[f],M=v.media,r=M.features["max-width"],o=M.features["min-width"];if(!r||!o){s++;break}let i=r.value-o.value;if(i===u){if(b!==v.hasWhere)continue;if(g!==-1){let d=[this.rules[f]];for(let h=f-1;h>=n;h--){let R=this.rules[h];if(R.hasWhere!==b)break;let p=R.media,T=p.features["max-width"],x=p.features["min-width"];if(!T||!x||T.value-x.value!==i)break;d.unshift(this.rules[h])}s=c(this.rules,h=>h.media&&h.priority!==-1&&h.media.features["min-width"]&&h.media.features["max-width"])}break}else if(i>u)break}}else if(m)for(let u=n;u<=a;u++){s=u;let f=this.rules[u],v=f.media,M=v.features["max-width"],r=v.features["min-width"];if(M){if(r)break;continue}let o=r?.value;if(o===m.value){if(!b&&f.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=u;i<=a;i++){let d=this.rules[i],h=d.media,R=h.features["min-width"];if(!h.features["max-width"]){if(d.hasWhere!==b||R.value!==o||d.order>=w)break;s=i+1}}break}else{if(o>m.value)break;s++}}else if(l)for(let u=a;u>=n;u--){s=u;let f=this.rules[u],v=f.media,M=v.features["max-width"];if(v.features["min-width"])continue;let o=M?.value;if(!o||o>l.value){s++;break}else if(o===l.value){if(b&&!f.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[u]];for(let d=u-1;d>=n;d--){let h=this.rules[d],R=h.media,p=R.features["min-width"],T=R.features["max-width"];if(!p&&(!T||T.value!==o||h.hasWhere!==b))break;i.unshift(h)}for(let d=0;d<i.length;d++){let h=i[d];if(!h.media.features["min-width"]){if(h.order>=w)break;s=u-i.length+2+d}}}break}}}if(s===void 0)if(n===-1)s=a+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(b){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<=a;l++){s=l;let m=this.rules[l],u=m.media;if(m.priority!==-1||u.features["max-width"]||u.features["min-width"])break;if(m.hasWhere)s++;else if(m.order>=w)break}}else if(g===-1)if(b)s=this.rules.findIndex(n=>!n.hasWhere||n.media||n.priority!==-1||n.order>=w),s===-1&&(s=a+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[O]=t,this.style){let n=this.style.sheet,l=0,m=u=>{let f=this.rules[u];if(f){if(!f.natives.length)return m(u-1);let v=f.natives[f.natives.length-1].cssRule;for(let M=0;M<n.cssRules.length;M++)if(n.cssRules[M]===v){l=M+1;break}}};m(s-1);for(let u=0;u<t.natives.length;)try{let f=t.natives[u];n.insertRule(f.text,l),f.cssRule=n.cssRules[l++],u++}catch(f){console.error(f),t.natives.splice(u,1)}}}}get text(){return this.rules.map(e=>e.text).join("")}},W=j;S(W,"root"),S(W,"config",F.config),S(W,"instances",[]),S(W,"refresh",e=>{for(let t of j.instances)t.refresh(e)});L&&(window.MasterCSS=W);0&&(module.exports={MasterCSS});
|
package/dist/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var c=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var A=Object.prototype.hasOwnProperty;var E=(o,t)=>{for(var n in t)c(o,n,{get:t[n],enumerable:!0})},l=(o,t,n,f)=>{if(t&&typeof t=="object"||typeof t=="function")for(let u of h(t))!A.call(o,u)&&u!==n&&c(o,u,{get:()=>t[u],enumerable:!(f=d(t,u))||f.enumerable});return o},r=(o,t,n)=>(l(o,t,"default"),n&&l(n,t,"default"));var g=o=>l(c({},"__esModule",{value:!0}),o);var e={};E(e,{default:()=>m.MasterCSS,extend:()=>i});module.exports=g(e);r(e,require("./css"),module.exports);r(e,require("./rule"),module.exports);r(e,require("./theme"),module.exports);var m=require("./css");function s(o){let t=typeof Buffer<"u"?Buffer:null;return!!(t&&o instanceof t||o instanceof Date||o instanceof RegExp)}function y(o){if(typeof Buffer<"u"&&Buffer&&o instanceof Buffer){let t=Buffer.alloc(o.length);return o.copy(t),t}else{if(o instanceof Date)return new Date(o.getTime());if(o instanceof RegExp)return new RegExp(o);throw new Error("Unexpected situation")}}function x(o){let t=[];return o.forEach(function(n,f){typeof n=="object"&&n!==null?Array.isArray(n)?t[f]=x(n):s(n)?t[f]=y(n):t[f]=i({},n):t[f]=n}),t}function p(o,t){return t==="__proto__"?void 0:o[t]}function i(...o){let t={},n,f;return o.forEach(function(u){typeof u!="object"||u===null||Array.isArray(u)||Object.keys(u).forEach(function(a){if(f=p(t,a),n=p(u,a),n!==t)if(typeof n!="object"||n===null){t[a]=n;return}else if(Array.isArray(n)){t[a]=x(n);return}else if(s(n)){t[a]=y(n);return}else if(typeof f!="object"||f===null||Array.isArray(f)){t[a]=i({},n);return}else{t[a]=i(f,n);return}})}),t}r(e,require("./methods"),module.exports);r(e,require("./config"),module.exports);
|
|
1
|
+
var c=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var A=Object.prototype.hasOwnProperty;var E=(o,t)=>{for(var n in t)c(o,n,{get:t[n],enumerable:!0})},l=(o,t,n,f)=>{if(t&&typeof t=="object"||typeof t=="function")for(let u of h(t))!A.call(o,u)&&u!==n&&c(o,u,{get:()=>t[u],enumerable:!(f=d(t,u))||f.enumerable});return o},r=(o,t,n)=>(l(o,t,"default"),n&&l(n,t,"default"));var g=o=>l(c({},"__esModule",{value:!0}),o);var e={};E(e,{default:()=>m.MasterCSS,extend:()=>i});module.exports=g(e);r(e,require("./css"),module.exports);r(e,require("./rule"),module.exports);r(e,require("./theme"),module.exports);var m=require("./css");function s(o){let t=typeof Buffer<"u"?Buffer:null;return!!(t&&o instanceof t||o instanceof Date||o instanceof RegExp)}function y(o){if(typeof Buffer<"u"&&Buffer&&o instanceof Buffer){let t=Buffer.alloc(o.length);return o.copy(t),t}else{if(o instanceof Date)return new Date(o.getTime());if(o instanceof RegExp)return new RegExp(o);throw new Error("Unexpected situation")}}function x(o){let t=[];return o.forEach(function(n,f){typeof n=="object"&&n!==null?Array.isArray(n)?t[f]=x(n):s(n)?t[f]=y(n):t[f]=i({},n):t[f]=n}),t}function p(o,t){return t==="__proto__"?void 0:o[t]}function i(...o){let t={},n,f;return o.forEach(function(u){typeof u!="object"||u===null||Array.isArray(u)||Object.keys(u).forEach(function(a){if(f=p(t,a),n=p(u,a),n!==t)if(typeof n!="object"||n===null){t[a]=n;return}else if(Array.isArray(n)){t[a]=x(n);return}else if(s(n)){t[a]=y(n);return}else if(typeof f!="object"||f===null||Array.isArray(f)){t[a]=i({},n);return}else{t[a]=i(f,n);return}})}),t}r(e,require("./methods"),module.exports);r(e,require("./config"),module.exports);0&&(module.exports={extend});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var t=(f,e,p,x)=>{if(e&&typeof e=="object"||typeof e=="function")for(let m of c(e))!d.call(f,m)&&m!==p&&a(f,m,{get:()=>e[m],enumerable:!(x=b(e,m))||x.enumerable});return f},r=(f,e,p)=>(t(f,e,"default"),p&&t(p,e,"default"));var g=f=>t(a({},"__esModule",{value:!0}),f);var o={};module.exports=g(o);r(o,require("./render"),module.exports);r(o,require("./render-from-html"),module.exports);r(o,require("./render-into-html"),module.exports);r(o,require("./fill-color-scale"),module.exports);r(o,require("./define-content"),module.exports);
|
|
1
|
+
var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var t=(f,e,p,x)=>{if(e&&typeof e=="object"||typeof e=="function")for(let m of c(e))!d.call(f,m)&&m!==p&&a(f,m,{get:()=>e[m],enumerable:!(x=b(e,m))||x.enumerable});return f},r=(f,e,p)=>(t(f,e,"default"),p&&t(p,e,"default"));var g=f=>t(a({},"__esModule",{value:!0}),f);var o={};module.exports=g(o);r(o,require("./render"),module.exports);r(o,require("./render-from-html"),module.exports);r(o,require("./render-into-html"),module.exports);r(o,require("./fill-color-scale"),module.exports);r(o,require("./define-content"),module.exports);r(o,require("./get-sync-with-stored-theme-script"),module.exports);
|
package/dist/config/index.d.ts
CHANGED
|
@@ -10,251 +10,7 @@ import { rules } from './rules';
|
|
|
10
10
|
import { override } from './override';
|
|
11
11
|
import { observe } from './observe';
|
|
12
12
|
import { important } from './important';
|
|
13
|
-
declare const config:
|
|
14
|
-
breakpoints: {
|
|
15
|
-
'3xs': number;
|
|
16
|
-
'2xs': number;
|
|
17
|
-
xs: number;
|
|
18
|
-
sm: number;
|
|
19
|
-
md: number;
|
|
20
|
-
lg: number;
|
|
21
|
-
xl: number;
|
|
22
|
-
'2xl': number;
|
|
23
|
-
'3xl': number;
|
|
24
|
-
'4xl': number;
|
|
25
|
-
};
|
|
26
|
-
colors: {
|
|
27
|
-
black: string;
|
|
28
|
-
white: string;
|
|
29
|
-
slate: any;
|
|
30
|
-
gray: any;
|
|
31
|
-
brown: any;
|
|
32
|
-
orange: any;
|
|
33
|
-
gold: any;
|
|
34
|
-
yellow: any;
|
|
35
|
-
grass: any;
|
|
36
|
-
green: any;
|
|
37
|
-
beryl: any;
|
|
38
|
-
teal: any;
|
|
39
|
-
cyan: any;
|
|
40
|
-
sky: any;
|
|
41
|
-
blue: any;
|
|
42
|
-
indigo: any;
|
|
43
|
-
violet: any;
|
|
44
|
-
purple: any;
|
|
45
|
-
fuchsia: any;
|
|
46
|
-
pink: any;
|
|
47
|
-
crimson: any;
|
|
48
|
-
red: any;
|
|
49
|
-
};
|
|
50
|
-
rootSize: number;
|
|
51
|
-
scope: string;
|
|
52
|
-
selectors: {
|
|
53
|
-
'::scrollbar': string;
|
|
54
|
-
'::scrollbar-button': string;
|
|
55
|
-
'::scrollbar-thumb': string;
|
|
56
|
-
'::scrollbar-track': string;
|
|
57
|
-
'::scrollbar-track-piece': string;
|
|
58
|
-
'::scrollbar-corner': string;
|
|
59
|
-
'::slider-thumb': string[];
|
|
60
|
-
'::slider-runnable-track': string[];
|
|
61
|
-
'::meter': string;
|
|
62
|
-
'::resizer': string;
|
|
63
|
-
'::progress': string;
|
|
64
|
-
':first': string;
|
|
65
|
-
':last': string;
|
|
66
|
-
':even': string;
|
|
67
|
-
':odd': string;
|
|
68
|
-
':nth(': string;
|
|
69
|
-
};
|
|
70
|
-
semantics: {
|
|
71
|
-
square: {
|
|
72
|
-
'aspect-ratio': string;
|
|
73
|
-
};
|
|
74
|
-
video: {
|
|
75
|
-
'aspect-ratio': string;
|
|
76
|
-
};
|
|
77
|
-
rounded: {
|
|
78
|
-
'border-radius': string;
|
|
79
|
-
};
|
|
80
|
-
round: {
|
|
81
|
-
'border-radius': string;
|
|
82
|
-
};
|
|
83
|
-
hidden: {
|
|
84
|
-
display: string;
|
|
85
|
-
};
|
|
86
|
-
hide: {
|
|
87
|
-
display: string;
|
|
88
|
-
};
|
|
89
|
-
block: {
|
|
90
|
-
display: string;
|
|
91
|
-
};
|
|
92
|
-
table: {
|
|
93
|
-
display: string;
|
|
94
|
-
};
|
|
95
|
-
flex: {
|
|
96
|
-
display: string;
|
|
97
|
-
};
|
|
98
|
-
grid: {
|
|
99
|
-
display: string;
|
|
100
|
-
};
|
|
101
|
-
contents: {
|
|
102
|
-
display: string;
|
|
103
|
-
};
|
|
104
|
-
inline: {
|
|
105
|
-
display: string;
|
|
106
|
-
};
|
|
107
|
-
'inline-block': {
|
|
108
|
-
display: string;
|
|
109
|
-
};
|
|
110
|
-
'inline-flex': {
|
|
111
|
-
display: string;
|
|
112
|
-
};
|
|
113
|
-
'inline-grid': {
|
|
114
|
-
display: string;
|
|
115
|
-
};
|
|
116
|
-
'inline-table': {
|
|
117
|
-
display: string;
|
|
118
|
-
};
|
|
119
|
-
'table-cell': {
|
|
120
|
-
display: string;
|
|
121
|
-
};
|
|
122
|
-
'table-caption': {
|
|
123
|
-
display: string;
|
|
124
|
-
};
|
|
125
|
-
'flow-root': {
|
|
126
|
-
display: string;
|
|
127
|
-
};
|
|
128
|
-
'list-item': {
|
|
129
|
-
display: string;
|
|
130
|
-
};
|
|
131
|
-
'table-row': {
|
|
132
|
-
display: string;
|
|
133
|
-
};
|
|
134
|
-
'table-column': {
|
|
135
|
-
display: string;
|
|
136
|
-
};
|
|
137
|
-
'table-row-group': {
|
|
138
|
-
display: string;
|
|
139
|
-
};
|
|
140
|
-
'table-column-group': {
|
|
141
|
-
display: string;
|
|
142
|
-
};
|
|
143
|
-
'table-header-group': {
|
|
144
|
-
display: string;
|
|
145
|
-
};
|
|
146
|
-
'table-footer-group': {
|
|
147
|
-
display: string;
|
|
148
|
-
};
|
|
149
|
-
italic: {
|
|
150
|
-
'font-style': string;
|
|
151
|
-
};
|
|
152
|
-
oblique: {
|
|
153
|
-
'font-style': string;
|
|
154
|
-
};
|
|
155
|
-
isolate: {
|
|
156
|
-
isolation: string;
|
|
157
|
-
};
|
|
158
|
-
overflow: {
|
|
159
|
-
overflow: string;
|
|
160
|
-
};
|
|
161
|
-
untouchable: {
|
|
162
|
-
'pointer-events': string;
|
|
163
|
-
};
|
|
164
|
-
static: {
|
|
165
|
-
position: string;
|
|
166
|
-
};
|
|
167
|
-
fixed: {
|
|
168
|
-
position: string;
|
|
169
|
-
};
|
|
170
|
-
abs: {
|
|
171
|
-
position: string;
|
|
172
|
-
};
|
|
173
|
-
rel: {
|
|
174
|
-
position: string;
|
|
175
|
-
};
|
|
176
|
-
sticky: {
|
|
177
|
-
position: string;
|
|
178
|
-
};
|
|
179
|
-
uppercase: {
|
|
180
|
-
'text-transform': string;
|
|
181
|
-
};
|
|
182
|
-
lowercase: {
|
|
183
|
-
'text-transform': string;
|
|
184
|
-
};
|
|
185
|
-
capitalize: {
|
|
186
|
-
'text-transform': string;
|
|
187
|
-
};
|
|
188
|
-
visible: {
|
|
189
|
-
visibility: string;
|
|
190
|
-
};
|
|
191
|
-
invisible: {
|
|
192
|
-
visibility: string;
|
|
193
|
-
};
|
|
194
|
-
vw: {
|
|
195
|
-
width: string;
|
|
196
|
-
};
|
|
197
|
-
vh: {
|
|
198
|
-
height: string;
|
|
199
|
-
};
|
|
200
|
-
'max-vw': {
|
|
201
|
-
'max-width': string;
|
|
202
|
-
};
|
|
203
|
-
'max-vh': {
|
|
204
|
-
'max-height': string;
|
|
205
|
-
};
|
|
206
|
-
'min-vw': {
|
|
207
|
-
'min-width': string;
|
|
208
|
-
};
|
|
209
|
-
'min-vh': {
|
|
210
|
-
'min-height': string;
|
|
211
|
-
};
|
|
212
|
-
'center-content': {
|
|
213
|
-
'justify-content': string;
|
|
214
|
-
'align-items': string;
|
|
215
|
-
};
|
|
216
|
-
'sr-only': {
|
|
217
|
-
position: string;
|
|
218
|
-
width: string;
|
|
219
|
-
height: string;
|
|
220
|
-
padding: string;
|
|
221
|
-
margin: string;
|
|
222
|
-
overflow: string;
|
|
223
|
-
clip: string;
|
|
224
|
-
'white-space': string;
|
|
225
|
-
'border-width': string;
|
|
226
|
-
};
|
|
227
|
-
full: {
|
|
228
|
-
width: string;
|
|
229
|
-
height: string;
|
|
230
|
-
};
|
|
231
|
-
center: {
|
|
232
|
-
left: number;
|
|
233
|
-
right: number;
|
|
234
|
-
'margin-left': string;
|
|
235
|
-
'margin-right': string;
|
|
236
|
-
};
|
|
237
|
-
middle: {
|
|
238
|
-
top: number;
|
|
239
|
-
bottom: number;
|
|
240
|
-
'margin-top': string;
|
|
241
|
-
'margin-bottom': string;
|
|
242
|
-
};
|
|
243
|
-
'break-spaces': {
|
|
244
|
-
'white-space': string;
|
|
245
|
-
};
|
|
246
|
-
'break-word': {
|
|
247
|
-
'overflow-wrap': string;
|
|
248
|
-
overflow: string;
|
|
249
|
-
};
|
|
250
|
-
};
|
|
251
|
-
themes: string[];
|
|
252
|
-
theme: ThemeConfig;
|
|
253
|
-
rules: Record<string, RuleConfig>;
|
|
254
|
-
override: boolean;
|
|
255
|
-
observe: boolean;
|
|
256
|
-
important: boolean;
|
|
257
|
-
};
|
|
13
|
+
declare const config: Config;
|
|
258
14
|
export { config, breakpoints, colors, rootSize, scope, selectors, semantics, themes, theme, rules, override, observe, important };
|
|
259
15
|
import type { RuleConfig } from '../rule';
|
|
260
16
|
import type { ThemeConfig } from '../theme';
|
package/dist/css.d.ts
CHANGED
package/dist/esm/bin/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
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();
|
|
2
|
+
import{program as c}from"commander";import w from"path";import{readPackage as S}from"../utils/read-package.js";import m from"chokidar";import a from"fs";import{defineContent as x}from"../methods/define-content.js";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();
|
|
@@ -1 +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};
|
|
1
|
+
import{fillColorScale as f}from"../methods/fill-color-scale.js";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};
|
package/dist/esm/config/index.js
CHANGED
|
@@ -1 +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 m}from"./themes";import{theme as n}from"./theme";import{rules as p}from"./rules";import{override as a}from"./override";import{observe as l}from"./observe";import{important as g}from"./important";var Q={breakpoints:e,colors:r,rootSize:s,scope:o,selectors:t,semantics:i,themes:m,theme:n,rules:p,override:a,observe:l,important:g};export{e as breakpoints,r as colors,Q as config,g as important,l as observe,a as override,s as rootSize,p as rules,o as scope,t as selectors,i as semantics,n as theme,m as themes};
|
|
1
|
+
import{breakpoints as e}from"./breakpoints.js";import{colors as r}from"./colors.js";import{rootSize as s}from"./root-size.js";import{scope as o}from"./scope.js";import{selectors as t}from"./selectors.js";import{semantics as i}from"./semantics.js";import{themes as m}from"./themes.js";import{theme as n}from"./theme.js";import{rules as p}from"./rules.js";import{override as a}from"./override.js";import{observe as l}from"./observe.js";import{important as g}from"./important.js";var Q={breakpoints:e,colors:r,rootSize:s,scope:o,selectors:t,semantics:i,themes:m,theme:n,rules:p,override:a,observe:l,important:g};export{e as breakpoints,r as colors,Q as config,g as important,l as observe,a as override,s as rootSize,p as rules,o as scope,t as selectors,i as semantics,n as theme,m as themes};
|