epiphany/node_modules/@csstools/postcss-logical-overflow/dist/index.cjs
2023-12-09 22:48:07 -08:00

1 line
907 B
JavaScript

"use strict";var o;function transformAxes(o,t){var e;const n=t?"-x":"-y",i=t?"-y":"-x",r=o.prop.toLowerCase().replace("-inline",n).replace("-block",i),l=o.value;null!=(e=o.parent)&&e.some((o=>"decl"==o.type&&o.prop===r&&o.value===l))||(o.cloneBefore({prop:r,value:l}),o.remove())}!function(o){o.TopToBottom="top-to-bottom",o.BottomToTop="bottom-to-top",o.RightToLeft="right-to-left",o.LeftToRight="left-to-right"}(o||(o={}));const creator=t=>{const e=Object.assign({inlineDirection:o.LeftToRight},t),n=Object.values(o);if(!n.includes(e.inlineDirection))throw new Error(`[postcss-logical-float-and-clear] "inlineDirection" must be one of ${n.join(", ")}`);const i=[o.LeftToRight,o.RightToLeft].includes(e.inlineDirection);return{postcssPlugin:"postcss-logical-overflow",Declaration:{"overflow-block":o=>transformAxes(o,i),"overflow-inline":o=>transformAxes(o,i)}}};creator.postcss=!0,module.exports=creator;