Skip to content

Commit

Permalink
fix(ui-components): better Header contrast in dark mode (#470)
Browse files Browse the repository at this point in the history
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Refactor**
- Updated the header component to refine its visual appearance for
different modes ("dark" and "light").
- **Tests**
- Adjusted tests to align with the updated styling logic for the header
component in both light and dark themes.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
aversini authored Apr 7, 2024
1 parent 9cdb411 commit ed2cd0d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions packages/ui-components/src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ export const Header = ({
noColors = false,
}: HeaderProps) => {
const headerClass = clsx(HEADER_CLASSNAME, getSpacing(spacing), {
"border-border-accent bg-surface-medium":
"border-border-accent bg-surface-dark":
mode === "dark" && !raw && !noColors,
"border-border-medium bg-surface-light":
mode === "light" && !raw && !noColors,
"border-border-accent bg-surface-light dark:border-border-medium dark:bg-surface-dark":
mode === "system" && !raw && !noColors,
"border-border-medium bg-surface-dark dark:border-border-accent dark:bg-surface-light":
"border-border-accent bg-surface-dark dark:border-border-medium dark:bg-surface-light":
mode === "alt-system" && !raw && !noColors,
"border-border-medium bg-surface-light dark:border-border-accent dark:bg-surface-dark":
mode === "system" && !raw && !noColors,
"border-b-4": !raw,
"border-transparent": !raw && noColors,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ describe("Header modifiers", () => {
const header = await screen.findByRole("banner");
expectToHaveClasses(header, [
HEADER_CLASSNAME,
"border-border-accent",
"dark:border-border-medium",
"border-border-medium",
"bg-surface-light",
"dark:border-border-accent",
"dark:bg-surface-dark",
]);
expectToHaveClasses(header.children[0], [
Expand All @@ -37,9 +37,9 @@ describe("Header modifiers", () => {
const header = await screen.findByRole("banner");
expectToHaveClasses(header, [
HEADER_CLASSNAME,
"border-border-medium",
"dark:border-border-accent",
"border-border-accent",
"bg-surface-dark",
"dark:border-border-medium",
"dark:bg-surface-light",
]);
expectToHaveClasses(header.children[0], [
Expand Down Expand Up @@ -78,7 +78,7 @@ describe("Header modifiers", () => {
expectToHaveClasses(header, [
HEADER_CLASSNAME,
"border-border-accent",
"bg-surface-medium",
"bg-surface-dark",
]);
expectToHaveClasses(header.children[0], [
"mt-0",
Expand Down

0 comments on commit ed2cd0d

Please sign in to comment.