Skip to content

Commit

Permalink
Merge pull request #516 from zendesk/gianluca/GG-3786-theme-colors
Browse files Browse the repository at this point in the history
fix: fixed styles with dark background and light brand color
  • Loading branch information
Fredx87 authored Aug 16, 2024
2 parents 38a130e + d173e64 commit 285aff6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
6 changes: 5 additions & 1 deletion assets/shared-bundle.js

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions src/modules/shared/garden-theme/createTheme.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import type { IButtonProps } from "@zendeskgarden/react-buttons";
import type { IGardenTheme } from "@zendeskgarden/react-theming";
import { DEFAULT_THEME } from "@zendeskgarden/react-theming";
import { css } from "styled-components";

export interface Settings {
background_color: string;
text_color: string;
brand_color: string;
brand_text_color: string;
link_color: string;
hover_link_color: string;
visited_link_color: string;
Expand All @@ -16,6 +19,7 @@ export function createTheme(settings: Settings): IGardenTheme {
rtl: document.dir === "rtl",
colors: {
...DEFAULT_THEME.colors,
background: settings.background_color,
foreground: settings.text_color,
primaryHue: settings.brand_color,
},
Expand All @@ -33,6 +37,13 @@ export function createTheme(settings: Settings): IGardenTheme {
color: ${settings.visited_link_color};
}
`,
"buttons.button": css`
${(props: IButtonProps) =>
props.isPrimary &&
css`
color: ${settings.brand_text_color};
`}
`,
},
};
}

0 comments on commit 285aff6

Please sign in to comment.