Skip to content

Commit 9e72ae0

Browse files
🐛 fix(bal-navigation): Service Link Background Color not correct on mobile (#1261)
* Create PR for #1243 * fix(nav): mobile has colored cards --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Gery Hirschfeld <gerhard.hirschfeld@baloise.ch>
1 parent a692194 commit 9e72ae0

4 files changed

Lines changed: 34 additions & 17 deletions

File tree

.changeset/thin-geese-laugh.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@baloise/design-system-components': patch
3+
---
4+
5+
The navigation component now provides enhanced support for colored service cards on mobile resolutions.

packages/components/src/components/bal-nav/bal-nav.sass

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
cursor: pointer
118118

119119
.bal-nav__mobile-section-item,
120-
.bal-nav__mobile-service-item
120+
.bal-nav__mobile-service-item > a
121121
display: flex
122122
justify-content: space-between
123123
align-items: center
@@ -186,8 +186,7 @@
186186
.bal-nav__mobile-section-list
187187
padding-top: 1rem
188188

189-
.bal-nav__mobile-service-list
190-
background: var(--bal-color-grey-3)
189+
.bal-nav__mobile-service-list > li
191190
border-radius: var(--bal-radius-normal)
192191
padding-top: 1rem
193192
padding-bottom: 1rem
@@ -213,10 +212,21 @@
213212

214213
.bal-nav__mobile-links--clickable,
215214
.bal-nav__mobile-section-item--clickable,
216-
.bal-nav__mobile-service-item--clickable
215+
.bal-nav__mobile-service-item--clickable > a
217216
cursor: pointer
218217

219218
.bal-nav__mobile-links--selected,
220219
.bal-nav__mobile-section-item--selected,
221-
.bal-nav__mobile-service-item--selected
220+
.bal-nav__mobile-service-item--selected > a
222221
text-decoration: underline
222+
223+
.bal-nav__mobile-service-item--color-grey
224+
background: var(--bal-nav-service-background-grey)
225+
.bal-nav__mobile-service-item--color-purple
226+
background: var(--bal-nav-service-background-purple)
227+
.bal-nav__mobile-service-item--color-red
228+
background: var(--bal-nav-service-background-red)
229+
.bal-nav__mobile-service-item--color-yellow
230+
background: var(--bal-nav-service-background-yellow)
231+
.bal-nav__mobile-service-item--color-green
232+
background: var(--bal-nav-service-background-green)

packages/components/src/components/bal-nav/bal-nav.vars.sass

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,8 @@
44

55
:root
66
--bal-nav-background: var(--bal-color-primary)
7+
--bal-nav-service-background-grey: var(--bal-color-grey)
8+
--bal-nav-service-background-purple: var(--bal-color-purple)
9+
--bal-nav-service-background-red: var(--bal-color-red)
10+
--bal-nav-service-background-yellow: var(--bal-color-yellow)
11+
--bal-nav-service-background-green: var(--bal-color-green)

packages/components/src/components/bal-nav/models/bal-nav-service-link-item.tsx

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,15 @@ export class NavServiceLinkItem extends NavLinkItem implements BalProps.BalNavSe
2727
const hasItems = this.linkItems && this.linkItems.length > 0
2828

2929
return (
30-
<li>
31-
<a
32-
id={this.id}
33-
class={{
34-
...block.element('mobile-service-item').class(),
35-
...block.element('mobile-service-item').modifier('selected').class(this.active),
36-
...block.element('mobile-service-item').modifier('clickable').class(this.clickable),
37-
}}
38-
href={this.href}
39-
target={this.target}
40-
onClick={ev => this.onClick(ev)}
41-
>
30+
<li
31+
class={{
32+
...block.element('mobile-service-item').class(),
33+
...block.element('mobile-service-item').modifier(`color-${this.color}`).class(),
34+
...block.element('mobile-service-item').modifier('selected').class(this.active),
35+
...block.element('mobile-service-item').modifier('clickable').class(this.clickable),
36+
}}
37+
>
38+
<a id={this.id} href={this.href} target={this.target} onClick={ev => this.onClick(ev)}>
4239
{this.label}
4340
</a>
4441
{hasItems ? (

0 commit comments

Comments
 (0)