Skip to content

Commit 8b35b97

Browse files
authored
Merge pull request #512 from Ajay-aot/bugfix/FWF-4439-additional-changes
additional changes for custom theming
2 parents b157812 + 64c67a1 commit 8b35b97

File tree

5 files changed

+16
-3
lines changed

5 files changed

+16
-3
lines changed

forms-flow-nav/src/root.component.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ export default function Root(props) {
4242
const headerHeight = headerRef.current?.offsetHeight || 0;
4343
const totalHeight = `calc(100% - ${headerHeight}px)`;
4444
setSidenavHeight(totalHeight);
45+
if (hasMultitenancyHeader) {
46+
StyleServices?.setCSSVariable("--client-nav", "3rem");
47+
}
4548
}, [ hasMultitenancyHeader ]);
4649

4750
return (

forms-flow-nav/src/sidenav/Sidebar.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@
210210
}
211211

212212
.multitenancy-logo {
213-
height: 1.5rem;
213+
height: var(--custom-logo-height) !important;
214214
margin-right: 0.5rem;
215215
}
216216

forms-flow-service/src/helpers/styleService.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ class StyleServices {
77
const value = getComputedStyle(element).getPropertyValue(variableName);
88
return value === '" "' ? "" : value;
99
}
10+
11+
// Set CSS variable utility
12+
public static setCSSVariable(
13+
variableName: string,
14+
value: string,
15+
element: HTMLElement = document.documentElement
16+
): void {
17+
element.style.setProperty(variableName, value);
18+
}
1019
}
1120

1221
export default StyleServices;

forms-flow-theme/scss/_theme.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ $theme-colors: map-merge($theme-colors, $custom-colors);
145145
--default-font-size: 1rem;
146146
--default-font-color: #{$gray-800};
147147
--navbar-width: 192px;
148+
--custom-logo-height: 1.5rem;
148149
//font-style
149150
--default-font-family-url:" ";
150151
--default-font-family: "Roboto", sans-serif;
@@ -199,7 +200,7 @@ $theme-colors: map-merge($theme-colors, $custom-colors);
199200
--radius-0150: 1.5rem;
200201
--radius-200: 2rem;
201202
//custom
202-
--client-nav: 3rem;
203+
--client-nav: 0px;
203204
--header-close-btn: 4.625rem;
204205
//custom danger
205206
--default-danger-color: #dc3545;

forms-flow-theme/scss/_variables.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ hr {
200200
background: var(--ff-main-bg);
201201
margin-left: var(--navbar-width);
202202
margin-top: 0;
203-
height: 100vh !important;
203+
height: calc(100vh - var(--client-nav)) !important;
204204
}
205205

206206
.min-container-height {

0 commit comments

Comments
 (0)