Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

fix(navbar): Restore the gradient background of the navbar

haitao(lj)13c472e1415e
diff --git a/ui/src/components/Header/index.scss b/ui/src/components/Header/index.scss
index bbcb74f8..e8c1c436 100644
--- a/ui/src/components/Header/index.scss
+++ b/ui/src/components/Header/index.scss
@@ -2,6 +2,7 @@
@import 'bootstrap/scss/variables';
#header {
--bs-navbar-padding-y: 0.75rem;
+ background: linear-gradient(180deg, rgb(var(--bs-primary-rgb)) 0%, rgba(var(--bs-primary-rgb), 0.95) 100%);
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15), 0 0.125rem 0.25rem rgb(0 0 0 / 8%);
.logo {
max-height: 1.75rem;
@@ -49,6 +50,11 @@
}
}
}
+
+ // style for colored navbar
+ &.theme-light {
+ background: linear-gradient(180deg, rgb(var(--bs-light-rgb)) 0%, rgba(var(--bs-light-rgb), 0.95) 100%);
+ }
}
diff --git a/ui/src/components/Header/index.tsx b/ui/src/components/Header/index.tsx
index c5daf7db..6f286651 100644
--- a/ui/src/components/Header/index.tsx
+++ b/ui/src/components/Header/index.tsx
@@ -82,10 +82,7 @@ const Header: FC = () => {
<Navbar
variant={themeType === 'theme-colored' ? 'dark' : ''}
expand="lg"
- className={classnames('sticky-top', themeType, {
- 'bg-light': themeType === 'theme-light',
- 'bg-primary': themeType !== 'theme-light',
- })}
+ className={classnames('sticky-top', themeType)}
id="header">
<Container className="d-flex align-items-center">
<Navbar.Toggle