Skip to content

Commit db88b8c

Browse files
authored
improvement(shellbar): apply latest VD spec (#167)
1 parent 0f32d40 commit db88b8c

File tree

4 files changed

+79
-49
lines changed

4 files changed

+79
-49
lines changed

packages/main/src/ShellBar.hbs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,28 @@
33
<div class="{{classes.leftContainer}}">
44

55
{{#if ctr.icon}}
6-
<div class="sapWCShellBarBeginIcon" tabindex="0">
7-
<slot name="{{ctr.icon._slot}}"></slot>
8-
</div>
6+
<slot name="{{ctr.icon._slot}}"></slot>
97
{{/if}}
108

119
{{#unless interactiveLogo}}
1210
<img class="{{classes.logo}}" src="{{ctr.logo}}" />
1311
{{/unless}}
1412

15-
<button tabindex="0" class="{{classes.button}}" @click="{{ctr._header.press}}">
16-
{{#if interactiveLogo}}
17-
<img class="{{classes.logo}}" src="{{ctr.logo}}" />
18-
{{/if}}
13+
{{#if showArrowDown}}
14+
<button tabindex="0" class="{{classes.button}}" @click="{{ctr._header.press}}">
15+
{{#if interactiveLogo}}
16+
<img class="{{classes.logo}}" src="{{ctr.logo}}" />
17+
{{/if}}
1918

20-
{{#if ctr.primaryTitle}}
21-
<h1 class="{{classes.buttonTitle}}">
22-
<bdi class="{{classes.title}}">{{ctr.primaryTitle}}</bdi>
23-
</h1>
24-
{{/if}}
19+
{{#if ctr.primaryTitle}}
20+
<h1 class="{{classes.buttonTitle}}">
21+
<bdi class="{{classes.title}}">{{ctr.primaryTitle}}</bdi>
22+
</h1>
23+
{{/if}}
2524

26-
<span class="{{classes.arrow}}"></span>
27-
</button>
25+
<span class="{{classes.arrow}}"></span>
26+
</button>
27+
{{/if}}
2828

2929
<h2 class="{{classes.secondaryTitle}}">{{ctr.secondaryTitle}}</h2>
3030
</div>

packages/main/src/ShellBarTemplateContext.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ class ShellBarTemplateContext {
1111
});
1212

1313
const isRTL = getRTL();
14+
const interactiveLogo = state._breakpointSize === "S";
1415

1516
return {
1617
ctr: state,
1718
_hiddenIcons: hiddenIcons,
1819
popoverHorizontalAlign: isRTL ? "Left" : "Right",
19-
interactiveLogo: state._breakpointSize === "S",
20+
interactiveLogo,
21+
showArrowDown: state.primaryTitle || (state.logo && interactiveLogo),
2022
styles: {
2123
searchField: {
2224
[isRTL ? "left" : "right"]: state._searchField.right,

packages/main/src/themes/base/ShellBar.less

Lines changed: 61 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ ui5-shellbar {
3838
.sapWCShellBarMenuButton,
3939
.sapWCShellBarIconButton,
4040
.sapWCShellBarImageButton,
41-
.sapWCShellBarBeginIcon {
41+
::slotted(ui5-icon) {
4242
height: 2.25rem;
4343
padding: 0;
4444
margin-left: 0.5rem;
@@ -52,26 +52,33 @@ ui5-shellbar {
5252
position: relative;
5353
font-size: 0.75rem;
5454
font-weight: bold;
55-
&:hover {
56-
background: @sapUiShellHoverBackground;
57-
}
58-
&:active {
59-
background: @sapUiHighlight;
60-
color: @sapUiShellActiveTextColor;
61-
}
62-
&:focus {
63-
&::after {
64-
content: "";
65-
position: absolute;
66-
width: ~"calc(100% - 0.375rem)";
67-
height: ~"calc(100% - 0.375rem)";
68-
border: 1px dotted @sapUiContentContrastFocusColor;
69-
pointer-events: none;
70-
left: 2px;
71-
top: 2px;
72-
z-index: 1;
73-
}
74-
}
55+
}
56+
57+
.sapWCShellBarMenuButton:hover,
58+
.sapWCShellBarIconButton:hover,
59+
.sapWCShellBarImageButton:hover {
60+
background: @sapUiShellHoverBackground;
61+
}
62+
63+
.sapWCShellBarMenuButton:active,
64+
.sapWCShellBarIconButton:active,
65+
.sapWCShellBarImageButton:active {
66+
background: @sapUiShellActiveBackground;
67+
color: @sapUiShellActiveTextColor;
68+
}
69+
70+
.sapWCShellBarMenuButton:focus::after,
71+
.sapWCShellBarIconButton:focus::after,
72+
.sapWCShellBarImageButton:focus::after {
73+
content: "";
74+
position: absolute;
75+
width: ~"calc(100% - 0.375rem)";
76+
height: ~"calc(100% - 0.375rem)";
77+
border: 1px dotted @sapUiContentContrastFocusColor;
78+
pointer-events: none;
79+
left: 2px;
80+
top: 2px;
81+
z-index: 1;
7582
}
7683

7784
.sapWCShellBarMenuButton::-moz-focus-inner {
@@ -173,7 +180,7 @@ ui5-shellbar {
173180
.sapWCShellBarSizeS {
174181
padding: 0.25rem 1rem;
175182

176-
& .sapWCShellBarBeginIcon {
183+
& ::slotted(ui5-icon) {
177184
margin-right: 0;
178185
}
179186

@@ -376,18 +383,8 @@ ui5-shellbar {
376383
background: @sapUiShellColor;
377384
}
378385

379-
.sapWCShellBarBeginIcon {
380-
width: 2.25rem;
381-
height: 2.25rem;
382-
margin-right: 0.5rem;
383-
margin-left: 0;
384-
display: flex;
385-
justify-content: center;
386-
align-items: center;
387-
}
388-
389386
span[dir=rtl] {
390-
& .sapWCShellBarBeginIcon {
387+
& ::slotted(ui5-icon) {
391388
margin-left: 0.5rem;
392389
margin-right: 0;
393390
}
@@ -414,4 +411,35 @@ span[dir=rtl] {
414411
& .sapWCShellBarSizeS .sapWCShellBarOverflowContainerRight{
415412
margin-right: 0;
416413
}
414+
}
415+
416+
::slotted(ui5-icon) {
417+
width: 2.25rem;
418+
height: 2.25rem;
419+
margin-right: 0.5rem;
420+
margin-left: 0;
421+
display: flex;
422+
justify-content: center;
423+
align-items: center;
424+
}
425+
426+
::slotted(ui5-icon:hover) {
427+
background: @sapUiShellHoverBackground;
428+
}
429+
430+
::slotted(ui5-icon:active) {
431+
background: @sapUiShellActiveBackground;
432+
color: @sapUiShellActiveTextColor;
433+
}
434+
435+
::slotted(ui5-icon:focus)::after {
436+
content: "";
437+
position: absolute;
438+
width: ~"calc(100% - 0.375rem)";
439+
height: ~"calc(100% - 0.375rem)";
440+
border: 1px dotted @sapUiContentContrastFocusColor;
441+
pointer-events: none;
442+
left: 2px;
443+
top: 2px;
444+
z-index: 1;
417445
}

packages/main/test/sap/ui/webcomponents/main/pages/ShellBar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
show-co-pilot
118118
>
119119

120-
<ui5-icon src="nav-back" data-ui5-slot="icon"></ui5-icon>
120+
<ui5-icon src="nav-back" data-ui5-slot="icon" tabindex="0"></ui5-icon>
121121

122122
<ui5-shellbar-item data-ui5-slot="items" id="disc" src="sap-icon://disconnected" text="Disconnect"></ui5-shellbar-item>
123123
<ui5-shellbar-item data-ui5-slot="items" id="call" src="sap-icon://incoming-call" text="Incoming Calls"></ui5-shellbar-item>

0 commit comments

Comments
 (0)