|
21 | 21 | display: flex; |
22 | 22 | align-items: center; |
23 | 23 | gap: variables.$db-spacing-fixed-3xs; // 2px between separator and item (small) |
| 24 | + } |
24 | 25 |
|
25 | | - // Separator icon (chevron-right) before each item except the first |
26 | | - &:not(:first-child)::before { |
27 | | - content: "\203A"; // Unicode chevron right (›) |
28 | | - display: flex; |
29 | | - align-items: center; |
30 | | - justify-content: center; |
31 | | - inline-size: variables.$db-sizing-sm; // 24px (small) |
32 | | - block-size: variables.$db-sizing-sm; |
33 | | - font-size: variables.$db-sizing-md; // 20px |
34 | | - color: colors.$db-adaptive-on-bg-basic-emphasis-100-default; |
35 | | - font-weight: 400; |
| 26 | + // Link and text styling (small) |
| 27 | + a, |
| 28 | + span { |
| 29 | + display: flex; |
| 30 | + align-items: center; |
| 31 | + padding: variables.$db-spacing-fixed-3xs variables.$db-spacing-fixed-2xs; // 2px 4px (small) |
| 32 | + border-radius: variables.$db-border-radius-xs; // 4px |
| 33 | + background-color: colors.$db-adaptive-bg-basic-transparent-full-default; |
| 34 | + color: colors.$db-adaptive-on-bg-basic-emphasis-100-default; |
| 35 | + font-size: variables.$db-sizing-sm; // 14px (body-sm) |
| 36 | + line-height: variables.$db-sizing-md; // 20px |
| 37 | + font-family: var(--db-font-family-sans); |
| 38 | + font-weight: 400; |
| 39 | + text-decoration: none; |
| 40 | + white-space: nowrap; |
| 41 | + transition: background-color 0.2s ease; |
| 42 | + |
| 43 | + &:hover, |
| 44 | + &:focus { |
| 45 | + background-color: colors.$db-adaptive-bg-basic-transparent-semi-default; |
| 46 | + text-decoration: underline; |
| 47 | + } |
| 48 | + |
| 49 | + &:active { |
| 50 | + background-color: colors.$db-adaptive-bg-basic-transparent-full-pressed; |
36 | 51 | } |
37 | 52 |
|
38 | | - // Link and text styling (small) |
| 53 | + @media screen and (prefers-reduced-motion: reduce) { |
| 54 | + transition: none; |
| 55 | + } |
| 56 | + } |
| 57 | + |
| 58 | + // Current page (last item with aria-current="page") |
| 59 | + li[aria-current="page"] { |
39 | 60 | a, |
40 | 61 | span { |
41 | | - display: flex; |
42 | | - align-items: center; |
43 | | - padding: variables.$db-spacing-fixed-3xs |
44 | | - variables.$db-spacing-fixed-2xs; // 2px 4px (small) |
45 | | - |
46 | | - border-radius: variables.$db-border-radius-xs; // 4px |
47 | | - background-color: colors.$db-adaptive-bg-basic-transparent-full-default; |
48 | | - color: colors.$db-adaptive-on-bg-basic-emphasis-100-default; |
49 | | - font-size: variables.$db-sizing-sm; // 14px (body-sm) |
50 | | - line-height: variables.$db-sizing-md; // 20px |
51 | | - font-family: var(--db-font-family-sans); |
52 | | - font-weight: 400; |
53 | | - text-decoration: none; |
54 | | - white-space: nowrap; |
55 | | - transition: background-color 0.2s ease; |
| 62 | + font-weight: 700; // Bold for current item |
| 63 | + cursor: default; |
| 64 | + pointer-events: none; |
56 | 65 |
|
57 | 66 | &:hover, |
58 | 67 | &:focus { |
59 | | - background-color: colors.$db-adaptive-bg-basic-transparent-semi-default; |
60 | | - text-decoration: underline; |
61 | | - } |
62 | | - |
63 | | - &:active { |
64 | | - background-color: colors.$db-adaptive-bg-basic-transparent-full-pressed; |
65 | | - } |
66 | | - |
67 | | - @media screen and (prefers-reduced-motion: reduce) { |
68 | | - transition: none; |
| 68 | + background-color: colors.$db-adaptive-bg-basic-transparent-full-default; |
| 69 | + text-decoration: none; |
69 | 70 | } |
70 | 71 | } |
| 72 | + } |
71 | 73 |
|
72 | | - // Current page (last item with aria-current="page") |
73 | | - &[aria-current="page"] { |
74 | | - a, |
75 | | - span { |
76 | | - font-weight: 700; // Bold for current item |
77 | | - cursor: default; |
78 | | - pointer-events: none; |
79 | | - |
80 | | - &:hover, |
81 | | - &:focus { |
82 | | - background-color: colors.$db-adaptive-bg-basic-transparent-full-default; |
83 | | - text-decoration: none; |
84 | | - } |
85 | | - } |
86 | | - } |
| 74 | + // Default chevron: apply when the breadcrumb does NOT request a slash |
| 75 | + &:not([data-separator="slash"]) |
| 76 | + .db-breadcrumb-list |
| 77 | + li:not(:first-child)::before { |
| 78 | + content: "›"; // chevron right glyph (U+203A) |
| 79 | + display: flex; |
| 80 | + align-items: center; |
| 81 | + justify-content: center; |
| 82 | + inline-size: variables.$db-sizing-sm; // 24px (small) |
| 83 | + block-size: variables.$db-sizing-sm; |
| 84 | + font-size: variables.$db-sizing-md; // 20px |
| 85 | + color: colors.$db-adaptive-on-bg-basic-emphasis-100-default; |
| 86 | + font-weight: 400; |
| 87 | + } |
| 88 | + |
| 89 | + // Slash separator override when component has data-separator="slash" |
| 90 | + &[data-separator="slash"] .db-breadcrumb-list li:not(:first-child)::before { |
| 91 | + content: "/"; // ASCII slash (0x2F) |
| 92 | + font-weight: 400; |
| 93 | + color: colors.$db-adaptive-on-bg-basic-emphasis-100-default; |
| 94 | + |
| 95 | + /* reduce the inline size so the slash doesn't create extra empty box */ |
| 96 | + inline-size: auto; |
| 97 | + block-size: auto; |
| 98 | + font-size: variables.$db-sizing-sm; // match small text sizing by default |
| 99 | + margin: 0 variables.$db-spacing-fixed-2xs; // small horizontal spacing |
87 | 100 | } |
88 | 101 |
|
89 | 102 | // Medium size variant |
|
114 | 127 | // Keep the medium padding but ensure comfortable tap/click area |
115 | 128 | padding: variables.$db-spacing-fixed-2xs |
116 | 129 | variables.$db-spacing-fixed-xs; // 4px 8px (medium) |
117 | | - |
118 | 130 | font-size: variables.$db-sizing-md; // 16px (body-md) |
119 | 131 | line-height: variables.$db-sizing-lg; // 24px |
120 | 132 | } |
|
0 commit comments