Clip
Clipping Utilities offer advanced visual edge trimming and design edge customization using CSS clip-path. These classes allow developers to create dynamic polygonal clip paths, define corner shapes, and optionally add decorative borders and inlays using CSS custom properties.
All classes use the al- prefix and follow utility-first conventions.
Overview
| Utility Class | Description |
|---|---|
| .al-clip-both | Combines both border and inlay with center cliping. |
| .al-clip-border | Border with center cliping. |
| .al-clip-inlay | Inlay with center cliping. |
| .al-clip | Base class for polygon clipping. Requires directional sizing variables. |
| .al-both | Basic border + inlay on a full rectangle. |
| .al-border | Basic border on a full rectangle. |
| .al-inlay | Basic inlay on a full rectangle. |
| .al-corner | Enables only corner-based clipping. |
| .al-extend-* | Sets the center clip width. |
| .al-center-* | Sets the clip center position. |
| .al-border-* | Sets the border width and color. |
| .al-inlay-* | Sets the inlay width and color. |
| .al-* | Sets the clip size. |
Sass Reference
$clip-sizes: (0:0, 1:1, 2:2, 3:3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, 10: 10, 11: 11, 12: 12, 13: 13, 14: 14, 15: 15, 16: 16, 20: 20, 24: 24, 25: 25, 26: 26, 28: 28, 30: 30, 32: 32, 34: 34, 35: 35, 36: 36, 48: 48, 50: 50, 64: 64, 75: 75, 80: 80, 96: 96, 112: 112 );
$clip-extend-sizes: (0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, 10: 10, 11: 11, 12: 12, 13: 13, 14: 14, 15: 15, 16: 16, 20: 20, 24: 24, 25: 25, 26: 26, 30: 30, 32: 32, 34: 34, 35: 35, 36: 36, 40: 40, 45: 45, 48: 48, 50: 50, 55: 55, 60: 60, 64: 64, 65: 65, 70: 70, 75: 75, 80: 80, 85: 85, 90: 90, 95: 95, 96: 96, 100: 100, 120: 120, 150: 150, 200: 200, 250: 250);
$clip-center-sizes: (0: 0%, 10: 10%, 25: 25%, 50: 50%, 75: 75%, 90: 90%, 100: 100%);
//inlay and border sizes
$clip-border-sizes: ( 1:1, 2:2, 3:3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, 10: 10, 15: 15, 16: 16, 20: 20, 24: 24, 25: 25, 30: 30, 32: 32);
$clip-border-color-opacity: ( 5: 0.05, 10: 0.10, 25: 0.25, 50: 0.50, 75: 0.75);
Clip Center with Inlay & Border
Initialize center clipping, inlay, and border using the .al-clip-both class
Add directional clipping with: .al-t-clip-x, .al-e-clip-y, .al-b-clip-x, .al-s-clip-y, or use .al-clip-all for full clipping on all sides.
Sizing center extend (.al-extend-t-* | .al-extend-e-* | .al-extend-b-* | .al-extend-s-* | al-extend-x-* | al-extend-y-* | al-extend-all-*)
Sizing center depth (.al-t-* | .al-e-* | .al-b-* | .al-s-* | al-x-* | al-y-* | al-all-*)
Clip Center with Border
Initialize Center & Border using the (.al-clip-border) class
Add directional clipping with: .al-t-clip-x, .al-e-clip-y, .al-b-clip-x, .al-s-clip-y, or use .al-clip-all for full clipping on all sides.
Sizing center extend (.al-extend-t-* | .al-extend-e-* | .al-extend-b-* | .al-extend-s-* | al-extend-x-* | al-extend-y-* | al-extend-all-*)
Sizing center depth (.al-t-* | .al-e-* | .al-b-* | .al-s-* | al-x-* | al-y-* | al-all-*)
Clip Center with Inlay
Initialize Center & Inlay using the (.al-clip-inlay) class
Add directional clipping with: .al-t-clip-x, .al-e-clip-y, .al-b-clip-x, .al-s-clip-y, or use .al-clip-all for full clipping on all sides.
Sizing center extend (.al-extend-t-* | .al-extend-e-* | .al-extend-b-* | .al-extend-s-* | al-extend-x-* | al-extend-y-* | al-extend-all-*)
Sizing center depth (.al-t-* | .al-e-* | .al-b-* | .al-s-* | al-x-* | al-y-* | al-all-*)
Clip Center
Initialize Center using the (.al-clip) class
Add directional clipping with: .al-t-clip-x, .al-e-clip-y, .al-b-clip-x, .al-s-clip-y, or use .al-clip-all for full clipping on all sides.
Sizing center extend (.al-extend-t-* | .al-extend-e-* | .al-extend-b-* | .al-extend-s-* | al-extend-x-* | al-extend-y-* | al-extend-all-*)
Sizing center depth (.al-t-* | .al-e-* | .al-b-* | .al-s-* | al-x-* | al-y-* | al-all-*)
Position center (.al-center-t-* | .al-center-e-* | .al-center-b-* | .al-center-s-* | al-center-all-*)
Clip Corner with Border & Inlay
Initialize Corner, Border, & Inlay using the (.al-corner & .al-both) class
Add clip corner with (.al-ts | .al-te | .al-be | .al-bs) , or use .al-corner-all for full clipping on all corners.
Border & Inlay Sizing (.al-border-* | .al-inlay-all-*)
Border & Inlay Colors (.al-border-* | .al-inlay-bg-*)
Clip Corner with Border
Initialize Corner & Border using the (.al-corner & .al-border) class
Add clip corner with (.al-ts | .al-te | .al-be | .al-bs) , or use .al-corner-all for full clipping on all corners.
Border Sizing (.al-border-*)
Border Colors (.al-border-*)
Clip Corner with Inlay
Initialize Corner & Inlay using the (.al-corner & .al-inlay) class
Add clip corner with (.al-ts | .al-te | .al-be | .al-bs) , or use .al-corner-all for full clipping on all corners.
Inlay Sizing (.al-inlay-all-*)
Inlay Colors (.al-inlay-bg-*)
Clip Corner
Initialize Corner using the (.al-corner) class
Add clip corner with (.al-ts | .al-te | .al-be | .al-bs) , or use .al-corner-all for full clipping on all corners.
Corner Sizing (.al-ts-* | .al-te-* | .al-be-* | .al-bs-* | .al-corner-all-*)
CSS Variables
Alfuix makes clipping and extending your UI even easier with local CSS variables. Just override variables for instant real-time custom colors, spacing, or sizing — while keeping full Sass support for deeper tweaks.
--al-ts: 16px;
--al-te: 16px;
--al-be: 16px;
--al-bs: 16px;
--al-t: 16px;
--al-e: 16px;
--al-b: 16px;
--al-s: 16px;
--al-extend-t: 16px;
--al-extend-e: 16px;
--al-extend-b: 16px;
--al-extend-s: 16px;
--al-center-t: 50%;
--al-center-e: 50%;
--al-center-b: 50%;
--al-center-s: 50%;
--al-border: 5px;
--al-border-bg: currentColor;
--al-inlay: 8px;
--al-inlay-bg: currentColor;
Developer Notes
-
These utilities rely heavily on clip-path: polygon() and CSS custom properties.
-
Use .al-clip, .al-clip-border, .al-clip-inlay, or .al-clip-both for activating clipping logic.
-
Adjust --al-* variables to customize each direction: --al-t, --al-e, --al-b, --al-s.
-
Corner clipping uses --al-ts, --al-te, --al-bs, --al-be.
-
RTL support is handled using [dir="rtl"] to switch start/end direction variables.
-
Always pair clip styles with a fallback (e.g., border-radius, overflow: hidden) for compatibility.