package.dist.esm.bundle.min.mjs.map Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of style-vendorizer Show documentation
Show all versions of style-vendorizer Show documentation
Tiny CSS vendor prefixer and property alias mapper for runtime styling solutions
The newest version!
{"version":3,"file":"bundle.min.mjs","sources":["../../src/index.ts"],"sourcesContent":["const enum CSSPrefixFlags {\n\t\"-webkit-\" = 1 << 0,\n\t\"-moz-\" = 1 << 1,\n\t\"-ms-\" = 1 << 2,\n}\n\nconst cssPropertyAliases = new Map([\n\t[\"align-self\", \"-ms-grid-row-align\"],\n\t[\"color-adjust\", \"-webkit-print-color-adjust\"],\n\t[\"column-gap\", \"grid-column-gap\"],\n\t[\"forced-color-adjust\", \"-ms-high-contrast-adjust\"],\n\t[\"gap\", \"grid-gap\"],\n\t[\"grid-template-columns\", \"-ms-grid-columns\"],\n\t[\"grid-template-rows\", \"-ms-grid-rows\"],\n\t[\"justify-self\", \"-ms-grid-column-align\"],\n\t[\"margin-inline-end\", \"-webkit-margin-end\"],\n\t[\"margin-inline-start\", \"-webkit-margin-start\"],\n\t[\"mask-border\", \"-webkit-mask-box-image\"],\n\t[\"mask-border-outset\", \"-webkit-mask-box-image-outset\"],\n\t[\"mask-border-slice\", \"-webkit-mask-box-image-slice\"],\n\t[\"mask-border-source\", \"-webkit-mask-box-image-source\"],\n\t[\"mask-border-repeat\", \"-webkit-mask-box-image-repeat\"],\n\t[\"mask-border-width\", \"-webkit-mask-box-image-width\"],\n\t[\"overflow-wrap\", \"word-wrap\"],\n\t[\"padding-inline-end\", \"-webkit-padding-end\"],\n\t[\"padding-inline-start\", \"-webkit-padding-start\"],\n\t[\"print-color-adjust\", \"color-adjust\"],\n\t[\"row-gap\", \"grid-row-gap\"],\n\t[\"scroll-margin-bottom\", \"scroll-snap-margin-bottom\"],\n\t[\"scroll-margin-left\", \"scroll-snap-margin-left\"],\n\t[\"scroll-margin-right\", \"scroll-snap-margin-right\"],\n\t[\"scroll-margin-top\", \"scroll-snap-margin-top\"],\n\t[\"scroll-margin\", \"scroll-snap-margin\"],\n\t[\"text-combine-upright\", \"-ms-text-combine-horizontal\"],\n]);\n\nexport function cssPropertyAlias(property: string): string | undefined {\n\treturn cssPropertyAliases.get(property);\n}\n\nexport function cssPropertyPrefixFlags(property: string): number {\n\tconst matches =\n\t\t/^(?:(text-(?:decoration$|e|or|si)|back(?:ground-cl|d|f)|box-d|mask(?:$|-[ispro]|-cl)|pr|hyphena|flex-d)|(tab-|column(?!-s)|text-align-l)|(ap)|u|hy)/i.exec(\n\t\t\tproperty,\n\t\t);\n\n\tif (!matches) return 0;\n\n\tif (matches[1]) return CSSPrefixFlags[\"-webkit-\"];\n\tif (matches[2]) return CSSPrefixFlags[\"-moz-\"];\n\tif (matches[3]) return CSSPrefixFlags[\"-moz-\"] | CSSPrefixFlags[\"-webkit-\"];\n\telse return CSSPrefixFlags[\"-ms-\"] | CSSPrefixFlags[\"-webkit-\"];\n}\n\nexport function cssValuePrefixFlags(property: string, value: string): number {\n\tconst matches =\n\t\t/^(?:(pos)|(cli)|(background-i)|(flex(?:$|-b)|(?:max-|min-)?(?:block-s|inl|he|widt))|dis)/i.exec(\n\t\t\tproperty,\n\t\t);\n\n\tif (!matches) return 0;\n\n\tif (matches[1]) {\n\t\t// position: \"sticky\"\n\t\treturn /^sti/i.test(value) ? CSSPrefixFlags[\"-webkit-\"] : 0;\n\t} else if (matches[2]) {\n\t\t// clip-path: \"path(…)\"\n\t\treturn /^pat/i.test(value) ? CSSPrefixFlags[\"-webkit-\"] : 0;\n\t} else if (matches[3]) {\n\t\t// background-image: \"image-set(…)\"\n\t\treturn /^image-/i.test(value) ? CSSPrefixFlags[\"-webkit-\"] : 0;\n\t} else if (matches[4]) {\n\t\t// flex(-basis)?|(max-|min-)?(width|inline-size|height|block-size): \"min-content\" | \"max-content\" | \"fit-content\"\n\t\treturn value[3] === \"-\" ? CSSPrefixFlags[\"-moz-\"] : 0;\n\t} else {\n\t\t// display: \"grid\" | \"inline-grid\"\n\t\treturn /^(?:inline-)?grid$/i.test(value) ? CSSPrefixFlags[\"-ms-\"] : 0;\n\t}\n}\n"],"names":["cssPropertyAliases","Map","cssPropertyAlias","property","get","cssPropertyPrefixFlags","matches","exec","cssValuePrefixFlags","value","test"],"mappings":"AAKA,IAAMA,EAAqB,IAAIC,IAAI,CAC/B,CAAC,aAAc,sBACf,CAAC,eAAgB,8BACjB,CAAC,aAAc,mBACf,CAAC,sBAAuB,4BACxB,CAAC,MAAO,YACR,CAAC,wBAAyB,oBAC1B,CAAC,qBAAsB,iBACvB,CAAC,eAAgB,yBACjB,CAAC,oBAAqB,sBACtB,CAAC,sBAAuB,wBACxB,CAAC,cAAe,0BAChB,CAAC,qBAAsB,iCACvB,CAAC,oBAAqB,gCACtB,CAAC,qBAAsB,iCACvB,CAAC,qBAAsB,iCACvB,CAAC,oBAAqB,gCACtB,CAAC,gBAAiB,aAClB,CAAC,qBAAsB,uBACvB,CAAC,uBAAwB,yBACzB,CAAC,qBAAsB,gBACvB,CAAC,UAAW,gBACZ,CAAC,uBAAwB,6BACzB,CAAC,qBAAsB,2BACvB,CAAC,sBAAuB,4BACxB,CAAC,oBAAqB,0BACtB,CAAC,gBAAiB,sBAClB,CAAC,uBAAwB,iCAEvB,SAAUC,EAAiBC,GAC7B,OAAOH,EAAmBI,IAAID,GAE5B,SAAUE,EAAuBF,GACnC,IAAMG,EAAU,uJAAuJC,KAAKJ,GAC5K,OAAKG,EAEDA,EAAQ,GAC0B,EAClCA,EAAQ,GACuB,EAC/BA,EAAQ,GACD,EAEA,EARA,EAUC,SAAAE,EAAoBL,EAAkBM,GAClD,IAAMH,EAAU,4FAA4FC,KAAKJ,GACjH,OAAKG,EAEDA,EAAQ,GAED,QAAQI,KAAKD,GAAoC,EAAE,EAErDH,EAAQ,GAEN,QAAQI,KAAKD,GAAoC,EAAE,EAErDH,EAAQ,GAEN,WAAWI,KAAKD,GAAoC,EAAE,EAExDH,EAAQ,GAEO,MAAbG,EAAM,GAAqC,EAAE,EAI7C,sBAAsBC,KAAKD,GAAgC,EAAE,EAnB7D"}