Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 1 addition & 3 deletions app/composables/useSettings.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import type { RemovableRef } from '@vueuse/core'
import { useLocalStorage } from '@vueuse/core'
import { ACCENT_COLORS } from '#shared/utils/constants'
import { ACCENT_COLORS, type AccentColorId } from '#shared/utils/constants'
import type { LocaleObject } from '@nuxtjs/i18n'
import { BACKGROUND_THEMES } from '#shared/utils/constants'

type BackgroundThemeId = keyof typeof BACKGROUND_THEMES

type AccentColorId = keyof typeof ACCENT_COLORS.light

/** Available search providers */
export type SearchProvider = 'npm' | 'algolia'

Expand Down
2 changes: 1 addition & 1 deletion app/utils/prehydrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function initPreferencesOnPrehydrate() {
'violet',
'magenta',
'neutral',
])
] satisfies typeof ACCENT_COLOR_IDS)

// Valid package manager IDs
const validPMs = new Set(['npm', 'pnpm', 'yarn', 'bun', 'deno', 'vlt'])
Expand Down
14 changes: 13 additions & 1 deletion shared/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,18 @@ export const DISCORD_COMMUNITY_URL = 'https://chat.npmx.dev'
export const DISCORD_BUILDERS_URL = 'https://build.npmx.dev'

// Theming
export const ACCENT_COLOR_IDS = [
'sky',
'coral',
'amber',
'emerald',
'violet',
'magenta',
'neutral',
] as const

export type AccentColorId = (typeof ACCENT_COLOR_IDS)[number]

export const ACCENT_COLORS = {
light: {
sky: 'oklch(0.53 0.16 247.27)',
Expand All @@ -78,7 +90,7 @@ export const ACCENT_COLORS = {
magenta: 'oklch(0.78 0.15 330)',
neutral: 'oklch(1 0 0)',
},
} as const
} as const satisfies Record<'light' | 'dark', Record<AccentColorId, string>>

export const BACKGROUND_THEMES = {
neutral: 'oklch(0.555 0 0)',
Expand Down
Loading