Skip to content

Commit 9984d95

Browse files
authored
refactor(ui5-toolbar): move styles to base theme (#175)
1 parent c776039 commit 9984d95

File tree

4 files changed

+27
-65
lines changed

4 files changed

+27
-65
lines changed

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

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@
99
/* CSS for control sap.m/Toolbar */
1010
/* Base theme */
1111
/* ============================== */
12+
@_ui5_toolbar_info_base_height: 2rem;
13+
@_ui5_toolbar_info_base_margin: 0;
14+
@_ui5_toolbar_info_base_padding: 0 0.5rem;
15+
@_ui5_toolbar_info_base_bottom_border: none;
16+
@_ui5_toolbar_standard_border_color: transparent;
17+
@_ui5_toolbar_info_standard_border: none;
18+
@_ui5_toolbar_info_standard_border_radius: 0;
1219

1320
:host(ui5-toolbar) {
1421
display: block;
@@ -43,7 +50,8 @@ ui5-toolbar {
4350
}
4451

4552
.sapMTBStandard {
46-
border-bottom: 1px solid @sapUiGroupTitleBorderColor;
53+
border: 1px solid @_ui5_toolbar_standard_border_color;
54+
border-bottom-color: @sapUiGroupTitleBorderColor;
4755
}
4856

4957
/* Transparent Toolbar Context */
@@ -92,9 +100,19 @@ ui5-toolbar {
92100
.sapMTB-Info-CTX.sapMTB {
93101
background: @sapUiInfobarBackground;
94102
color: contrast(@sapUiInfobarBackground, @sapUiListActiveTextColor, @sapUiListTextColor, @sapUiContentContrastTextThreshold);
103+
height: @_ui5_toolbar_info_base_height;
104+
margin: @_ui5_toolbar_info_base_margin;
105+
padding: @_ui5_toolbar_info_base_padding;
106+
border-bottom: @_ui5_toolbar_info_base_bottom_border;
95107
}
96108

97-
/********** COMPACT DESIGN ************/
109+
.sapMTB-Info-CTX.sapMTB.sapMTBStandard {
110+
border: @_ui5_toolbar_info_standard_border;
111+
border-radius: @_ui5_toolbar_info_standard_border_radius;
112+
}
113+
114+
115+
/********** COMPACT DESIGN ************/
98116

99117
/* toolbar has 2rem height in compact mode */
100118
.sapUiSizeCompact .sapMTB {

packages/main/src/themes/sap_belize/Toolbar.less

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,3 @@
1414
/* Belize theme */
1515
/* ============================== */
1616

17-
/* Info Toolbar Context */
18-
.sapMTB-Info-CTX.sapMTB {
19-
height: 2rem;
20-
padding: 0 0.5rem;
21-
border-bottom: none;
22-
}

packages/main/src/themes/sap_belize_hcb/Toolbar.less

Lines changed: 7 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -10,48 +10,10 @@
1010
@import "./base.less";
1111
@import "./global.less";
1212

13-
html.sap-desktop .sapMTBActive:focus {
14-
outline: 0.125rem dotted @sapUiContentContrastFocusColor;
15-
outline-offset: -0.1875rem;
16-
}
17-
18-
/* Info Toolbar Context */
19-
.sapMTB-Info-CTX.sapMTB {
20-
height: 1.75rem;
21-
padding: 0 .25rem 0 .5rem;
22-
margin: 0.125rem 0.1875rem;
23-
}
24-
25-
.sapMTB-Info-CTX.sapMTB.sapMTBStandard {
26-
border: 0.125rem solid @sapUiGroupTitleBorderColor;
27-
border-radius: 0.3125rem;
28-
}
29-
30-
/* IE ignores outline-offset. Use an overlay: */
31-
/* TODO remove after 1.62 version */
32-
html[data-sap-ui-browser^="ie"].sap-desktop {
33-
.sapMTBActive:focus {
34-
outline: none;
35-
position: relative;
36-
}
37-
.sapMTBActive:focus:before {
38-
content: " ";
39-
box-sizing: border-box;
40-
width: calc(~'100% - 0.0625rem');
41-
height: calc(~'100% - 0.0625rem');
42-
position: absolute;
43-
left: 0;
44-
top: 0;
45-
border: 0.125rem dotted @sapUiContentContrastFocusColor;
46-
pointer-events: none;
47-
}
48-
}
49-
50-
/* HCB Additional Styles */
51-
.sapMTB-Solid-CTX.sapMTB.sapMTBStandard {
52-
border: 1px solid @sapUiGroupTitleBorderColor;
53-
}
54-
55-
.sapMFooter-CTX.sapMTB.sapMTBStandard {
56-
border-top: 1px solid @sapUiPageFooterBorderColor;
57-
}
13+
@_ui5_toolbar_info_base_height: 1.75rem;
14+
@_ui5_toolbar_info_base_margin: .125rem .1875rem;
15+
@_ui5_toolbar_info_base_padding: 0 .25rem 0 .5rem;
16+
@_ui5_toolbar_info_base_bottom_border: none;
17+
@_ui5_toolbar_standard_border_color: @sapUiGroupTitleBorderColor;
18+
@_ui5_toolbar_info_standard_border: 0.125rem solid @sapUiGroupTitleBorderColor;
19+
@_ui5_toolbar_info_standard_border_radius: 0.3125rem;

packages/main/src/themes/sap_fiori_3/Toolbar.less

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,3 @@
88
/* ============================= */
99
@import "./base.less";
1010
@import "./global.less";
11-
12-
/* ============================== */
13-
/* CSS for control sap.m/Toolbar */
14-
/* Belize theme */
15-
/* ============================== */
16-
17-
/* Info Toolbar Context */
18-
.sapMTB-Info-CTX.sapMTB {
19-
height: 2rem;
20-
padding: 0 0.5rem;
21-
border-bottom: none;
22-
}

0 commit comments

Comments
 (0)