diff options
Diffstat (limited to 'node_modules/@csstools/postcss-logical-float-and-clear/dist')
6 files changed, 33 insertions, 0 deletions
diff --git a/node_modules/@csstools/postcss-logical-float-and-clear/dist/index.cjs b/node_modules/@csstools/postcss-logical-float-and-clear/dist/index.cjs new file mode 100644 index 00000000..c073727d --- /dev/null +++ b/node_modules/@csstools/postcss-logical-float-and-clear/dist/index.cjs @@ -0,0 +1 @@ +"use strict";const t="inline-start",o="inline-end";var e,i;function directionFlowToAxes(t){switch(t){case e.TopToBottom:return[i.Top,i.Bottom];case e.BottomToTop:return[i.Bottom,i.Top];case e.RightToLeft:return[i.Right,i.Left];case e.LeftToRight:return[i.Left,i.Right]}}function cloneDeclaration(t,o,e){t.parent&&t.parent.some((t=>"decl"==t.type&&t.prop===e&&t.value===o))||t.cloneBefore({value:o,prop:e})}!function(t){t.TopToBottom="top-to-bottom",t.BottomToTop="bottom-to-top",t.RightToLeft="right-to-left",t.LeftToRight="left-to-right"}(e||(e={})),function(t){t.Top="top",t.Right="right",t.Bottom="bottom",t.Left="left"}(i||(i={}));const creator=i=>{const n=Object.assign({inlineDirection:e.LeftToRight},i),c=Object.values(e);if(!c.includes(n.inlineDirection))throw new Error(`[postcss-logical-float-and-clear] "inlineDirection" must be one of ${c.join(", ")}`);if(![e.LeftToRight,e.RightToLeft].includes(n.inlineDirection))return{postcssPlugin:"postcss-logical-float-and-clear",Once(){}};const[r,l]=directionFlowToAxes(n.inlineDirection),makeTransform=e=>{const i=e.value.toLowerCase();if(![t,o].includes(i))return;cloneDeclaration(e,i===t?r:l,e.prop),e.remove()};return{postcssPlugin:"postcss-logical-float-and-clear",Declaration:{float:makeTransform,clear:makeTransform}}};creator.postcss=!0,module.exports=creator; diff --git a/node_modules/@csstools/postcss-logical-float-and-clear/dist/index.d.ts b/node_modules/@csstools/postcss-logical-float-and-clear/dist/index.d.ts new file mode 100644 index 00000000..8faa333f --- /dev/null +++ b/node_modules/@csstools/postcss-logical-float-and-clear/dist/index.d.ts @@ -0,0 +1,9 @@ +import type { PluginCreator } from 'postcss'; +import { DirectionFlow } from './lib/types'; +/** postcss-logical-float-and-clear plugin options */ +export type pluginOptions = { + /** Sets the direction for inline. default: left-to-right */ + inlineDirection?: DirectionFlow; +}; +declare const creator: PluginCreator<pluginOptions>; +export default creator; diff --git a/node_modules/@csstools/postcss-logical-float-and-clear/dist/index.mjs b/node_modules/@csstools/postcss-logical-float-and-clear/dist/index.mjs new file mode 100644 index 00000000..f05b6578 --- /dev/null +++ b/node_modules/@csstools/postcss-logical-float-and-clear/dist/index.mjs @@ -0,0 +1 @@ +const t="inline-start",o="inline-end";var e,n;function directionFlowToAxes(t){switch(t){case e.TopToBottom:return[n.Top,n.Bottom];case e.BottomToTop:return[n.Bottom,n.Top];case e.RightToLeft:return[n.Right,n.Left];case e.LeftToRight:return[n.Left,n.Right]}}function cloneDeclaration(t,o,e){t.parent&&t.parent.some((t=>"decl"==t.type&&t.prop===e&&t.value===o))||t.cloneBefore({value:o,prop:e})}!function(t){t.TopToBottom="top-to-bottom",t.BottomToTop="bottom-to-top",t.RightToLeft="right-to-left",t.LeftToRight="left-to-right"}(e||(e={})),function(t){t.Top="top",t.Right="right",t.Bottom="bottom",t.Left="left"}(n||(n={}));const creator=n=>{const i=Object.assign({inlineDirection:e.LeftToRight},n),c=Object.values(e);if(!c.includes(i.inlineDirection))throw new Error(`[postcss-logical-float-and-clear] "inlineDirection" must be one of ${c.join(", ")}`);if(![e.LeftToRight,e.RightToLeft].includes(i.inlineDirection))return{postcssPlugin:"postcss-logical-float-and-clear",Once(){}};const[r,l]=directionFlowToAxes(i.inlineDirection),makeTransform=e=>{const n=e.value.toLowerCase();if(![t,o].includes(n))return;cloneDeclaration(e,n===t?r:l,e.prop),e.remove()};return{postcssPlugin:"postcss-logical-float-and-clear",Declaration:{float:makeTransform,clear:makeTransform}}};creator.postcss=!0;export{creator as default}; diff --git a/node_modules/@csstools/postcss-logical-float-and-clear/dist/lib/clone-declaration.d.ts b/node_modules/@csstools/postcss-logical-float-and-clear/dist/lib/clone-declaration.d.ts new file mode 100644 index 00000000..1503bf6f --- /dev/null +++ b/node_modules/@csstools/postcss-logical-float-and-clear/dist/lib/clone-declaration.d.ts @@ -0,0 +1,2 @@ +import type { Declaration } from 'postcss'; +export declare function cloneDeclaration(declaration: Declaration, value: string, prop: string): void; diff --git a/node_modules/@csstools/postcss-logical-float-and-clear/dist/lib/types.d.ts b/node_modules/@csstools/postcss-logical-float-and-clear/dist/lib/types.d.ts new file mode 100644 index 00000000..2b3c47f9 --- /dev/null +++ b/node_modules/@csstools/postcss-logical-float-and-clear/dist/lib/types.d.ts @@ -0,0 +1,18 @@ +export declare const DirectionValues: { + BlockStart: string; + BlockEnd: string; + InlineStart: string; + InlineEnd: string; +}; +export declare enum DirectionFlow { + TopToBottom = "top-to-bottom", + BottomToTop = "bottom-to-top", + RightToLeft = "right-to-left", + LeftToRight = "left-to-right" +} +export declare enum Axes { + Top = "top", + Right = "right", + Bottom = "bottom", + Left = "left" +} diff --git a/node_modules/@csstools/postcss-logical-float-and-clear/dist/utils/direction-flow-to-axes.d.ts b/node_modules/@csstools/postcss-logical-float-and-clear/dist/utils/direction-flow-to-axes.d.ts new file mode 100644 index 00000000..2652d71d --- /dev/null +++ b/node_modules/@csstools/postcss-logical-float-and-clear/dist/utils/direction-flow-to-axes.d.ts @@ -0,0 +1,2 @@ +import { DirectionFlow, Axes } from '../lib/types'; +export declare function directionFlowToAxes(directionFlow: DirectionFlow): [Axes, Axes]; |
