|
1 | 1 | @import "../../../css/partials.meta";
|
2 | 2 | @import "tab-bar.variables";
|
| 3 | +@import "../../00-base/icons/icons.helpers"; |
| 4 | + |
| 5 | +@mixin tab() { |
| 6 | + & > input[type="radio"], |
| 7 | + & > * > input[type="radio"] { |
| 8 | + @content; |
| 9 | + } |
| 10 | +} |
3 | 11 |
|
4 | 12 | .cmp-tab-bar {
|
5 | 13 | display: flex;
|
6 | 14 | flex-wrap: wrap;
|
7 | 15 |
|
8 |
| - label[role="tab"], |
9 |
| - section[role="tabpanel"] { |
10 |
| - background-color: $tabBar-tabSection--backgroundColor; |
11 |
| - } |
| 16 | + gap: 0.25rem; |
12 | 17 |
|
13 |
| - & > input[type="radio"], |
14 |
| - & > * > input[type="radio"] { |
| 18 | + @include tab() { |
15 | 19 | @include a11y-visually-hidden($partial: $partial);
|
16 | 20 |
|
17 | 21 | & + label[role="tab"] {
|
18 |
| - border-top-left-radius: 4px; |
19 |
| - border-top-right-radius: 4px; |
20 | 22 | cursor: pointer;
|
21 |
| - display: inline-block; |
22 |
| - margin-left: to-rem($pxValue: 8); |
23 |
| - padding: #{to-rem($pxValue: 5)} #{to-rem($pxValue: 32)}; |
| 23 | + display: flex; |
| 24 | + padding: 0.875rem $db-spacing-m; |
24 | 25 | position: relative;
|
25 | 26 | z-index: 1;
|
| 27 | + border-radius: 4px; |
| 28 | + align-items: center; |
26 | 29 |
|
27 |
| - &:first-of-type { |
28 |
| - margin-left: to-rem($pxValue: 16); |
| 30 | + &::before { |
| 31 | + margin-inline-start: -0.125rem; |
29 | 32 | }
|
30 | 33 | }
|
31 | 34 |
|
|
39 | 42 | &:focus {
|
40 | 43 | background-color: $tabBar-tab-hover-backgroundColor;
|
41 | 44 | }
|
| 45 | + |
| 46 | + &:active { |
| 47 | + background-color: $tabBar-tab-pressed-backgroundColor; |
| 48 | + } |
42 | 49 | }
|
43 | 50 | }
|
44 | 51 |
|
|
55 | 62 |
|
56 | 63 | &:checked {
|
57 | 64 | & + label[role="tab"] {
|
58 |
| - border: $tabBar-tab-active-border; |
59 |
| - border-bottom: none; |
60 | 65 | font-weight: 700;
|
61 |
| - padding-top: to-rem($pxValue: 3); |
62 |
| - transform: translateY(to-rem($pxValue: 1)); |
63 | 66 |
|
64 | 67 | & + section[role="tabpanel"] {
|
65 | 68 | display: initial;
|
66 | 69 | }
|
| 70 | + |
| 71 | + // Puls |
| 72 | + &::after { |
| 73 | + background-color: $db-color-red-500; |
| 74 | + border-radius: 5px; |
| 75 | + content: ""; |
| 76 | + display: block; |
| 77 | + height: 0.25rem; |
| 78 | + inset-block-end: 0; |
| 79 | + inset-inline: 0; |
| 80 | + position: absolute; |
| 81 | + } |
67 | 82 | }
|
68 | 83 | }
|
69 | 84 | }
|
70 | 85 |
|
| 86 | + label[role="tab"], |
| 87 | + section[role="tabpanel"] { |
| 88 | + background-color: $tabBar-tabSection--backgroundColor; |
| 89 | + } |
| 90 | + |
71 | 91 | section[role="tabpanel"] {
|
72 |
| - border-top: $tabBar-tabpanel--borderTop; |
73 |
| - box-shadow: $tabBar-tabpanel--boxShadow; |
74 | 92 | display: none;
|
75 | 93 | flex-basis: 100%;
|
76 | 94 | order: 1;
|
77 |
| - padding: to-rem($pxValue: 46) to-rem($pxValue: 50); |
| 95 | + margin-block-start: 0.125rem; |
| 96 | + } |
| 97 | + |
| 98 | + &[data-size="small"] { |
| 99 | + @include tab() { |
| 100 | + & + label[role="tab"] { |
| 101 | + padding-block: 0.625rem; |
| 102 | + } |
| 103 | + } |
78 | 104 | }
|
79 | 105 | }
|
0 commit comments