File tree Expand file tree Collapse file tree 1 file changed +2
-25
lines changed
app/pages/share-card/[[org]] Expand file tree Collapse file tree 1 file changed +2
-25
lines changed Original file line number Diff line number Diff line change 11<script setup lang="ts">
2- import { ACCENT_COLOR_IDS , type AccentColorId } from ' #shared/utils/constants'
2+ import { ACCENT_COLOR_IDS , ACCENT_COLOR_TOKENS , type AccentColorId } from ' #shared/utils/constants'
33
44// This page exists only as a rendering target for nuxt-og-image.
55// Visiting it directly redirects to the package page.
66
7- // Hex equivalents of ACCENT_COLORS for satori (which doesn't support oklch).
8- // These approximate the oklch values visually.
9- const ACCENT_HEX: Record <' light' | ' dark' , Record <AccentColorId , string >> = {
10- dark: {
11- sky: ' #5bc4e0' ,
12- coral: ' #f07858' ,
13- amber: ' #f0c040' ,
14- emerald: ' #40d088' ,
15- violet: ' #9880e8' ,
16- magenta: ' #d878c0' ,
17- neutral: ' #ffffff' ,
18- },
19- light: {
20- sky: ' #2870c0' ,
21- coral: ' #c04030' ,
22- amber: ' #b07020' ,
23- emerald: ' #208060' ,
24- violet: ' #7050b8' ,
25- magenta: ' #a040a0' ,
26- neutral: ' #1a1a1a' ,
27- },
28- }
29-
307const route = useRoute ()
318const org = (route .params as any ).org as string | undefined
329const name = (route .params as any ).name as string
@@ -37,7 +14,7 @@ const color: AccentColorId = ACCENT_COLOR_IDS.includes(colorParam as AccentColor
3714 ? (colorParam as AccentColorId )
3815 : ' sky'
3916
40- const primaryColor = ACCENT_HEX [ theme ][ color ]
17+ const primaryColor = ACCENT_COLOR_TOKENS [ color ][ theme ]. hex
4118
4219defineOgImageComponent (
4320 ' ShareCard' ,
You can’t perform that action at this time.
0 commit comments