Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,12 @@ export const getAppConfig = cache(async (headers: Headers): Promise<AppConfig> =
// generate a hover color for the accent color by mixing it with 20% black
export function getStyles(appConfig: AppConfig) {
const { accent, accentDark } = appConfig;
const hasCustomAccentColor =
process.env.NODE_ENV === 'development' || accent !== APP_CONFIG_DEFAULTS.accent;
const hasCustomAccentDarkColor =
process.env.NODE_ENV === 'development' || accentDark !== APP_CONFIG_DEFAULTS.accentDark;

return [
hasCustomAccentColor
accent
? `:root { --primary: ${accent}; --primary-hover: color-mix(in srgb, ${accent} 80%, #000); }`
: '',
hasCustomAccentDarkColor
accentDark
? `.dark { --primary: ${accentDark}; --primary-hover: color-mix(in srgb, ${accentDark} 80%, #000); }`
: '',
]
Expand Down