|
1 | 1 | // Mixins for pseudo-element patterns |
2 | 2 |
|
| 3 | +/** |
| 4 | + * Base mixin for creating positioned pseudo-elements with consistent sizing |
| 5 | + * Used as foundation for all tab filler pseudo-elements |
| 6 | + * @param {string} $side - Which side to position the element (left|right) |
| 7 | + * @param {length} $height - Height of the pseudo-element |
| 8 | + */ |
| 9 | + |
3 | 10 | @mixin pseudo-base($side: left, $height: var(--tab-filler-size)) { |
4 | 11 | position: absolute; |
5 | 12 | top: 100%; |
|
12 | 19 | background-color: var(--g-color-base-background); |
13 | 20 | } |
14 | 21 |
|
| 22 | +/** |
| 23 | + * Creates a vertical filler for active tab states |
| 24 | + * Used to extend the active tab's background below the container |
| 25 | + * @param {string} $side - Which side to position the filler (left|right) |
| 26 | + */ |
| 27 | + |
15 | 28 | @mixin pseudo-active-filler($side: left) { |
16 | 29 | @include pseudo-base($side, var(--g-spacing-3)); |
17 | 30 | border-#{$side}: var(--tab-border-width) solid var(--g-color-line-generic); |
18 | 31 | } |
19 | 32 |
|
| 33 | +/** |
| 34 | + * Creates a rounded corner filler for inactive tab states |
| 35 | + * Provides visual separation between tabs with border and radius |
| 36 | + * @param {string} $side - Which side to position the filler (left|right) |
| 37 | + */ |
| 38 | + |
20 | 39 | @mixin pseudo-inactive-filler($side: left) { |
21 | 40 | border-top: var(--tab-border-width) solid var(--g-color-line-generic); |
22 | 41 | @include pseudo-base($side, var(--tab-filler-size)); |
23 | 42 | border-#{$side}: var(--tab-border-width) solid var(--g-color-line-generic); |
24 | 43 | border-top-#{$side}-radius: var(--g-border-radius-s); |
25 | 44 | } |
26 | 45 |
|
| 46 | +/** |
| 47 | + * Creates a simple background fill without borders |
| 48 | + * Used as a background layer behind other pseudo-elements |
| 49 | + * @param {string} $side - Which side to position the fill (left|right) |
| 50 | + */ |
| 51 | + |
27 | 52 | @mixin pseudo-background-fill($side: left) { |
28 | 53 | @include pseudo-base($side, var(--tab-filler-size)); |
29 | 54 | } |
30 | 55 |
|
31 | 56 | // Utility mixins for common patterns |
32 | 57 |
|
| 58 | +/** |
| 59 | + * Consistent tab border styling for both active and inactive states |
| 60 | + * Creates the characteristic tab shape with top and side borders only |
| 61 | + * @param {color} $color - Border color to use |
| 62 | + */ |
| 63 | + |
33 | 64 | @mixin tab-border-base($color) { |
34 | 65 | border: var(--tab-border-width) solid $color; |
35 | 66 | border-bottom: none; |
36 | 67 | border-radius: var(--g-border-radius-s) var(--g-border-radius-s) 0 0; |
37 | 68 | } |
38 | 69 |
|
| 70 | +/** |
| 71 | + * Complete edge filler system for first/last tabs |
| 72 | + * Handles all pseudo-element states (active/inactive, ::before/::after) |
| 73 | + * Creates the complex tab connection visuals for edge containers |
| 74 | + * @param {string} $side - Which edge this applies to (left|right) |
| 75 | + */ |
| 76 | + |
39 | 77 | @mixin tab-edge-filler($side) { |
40 | 78 | &.tenant-metrics-cards__link-container_active::after { |
41 | 79 | @include pseudo-active-filler($side); |
|
0 commit comments