satori icon indicating copy to clipboard operation
satori copied to clipboard

Access to custom Tailwind config through `ImageResponse`

Open shuding opened this issue 1 year ago • 3 comments

          @marcbouchenoire @shuding Do you know if it's possible to access this config option through `ImageResponse`? Just trying to figure out how to use it with the `opengraph-image` files in Next 13. Thanks!

Originally posted by @kieranm in https://github.com/vercel/satori/issues/340#issuecomment-1571925362

shuding avatar Jun 01 '23 13:06 shuding

@shuding is there any plans to work on this, or any workaround I can make? I was trying to use ImageResponse from next/server, but since it didn't work, I just tried to directly use satori, which caused an issue:

- error node_modules/.pnpm/@[email protected]/node_modules/@shuding/opentype.js/dist/opentype.module.js (10279:22) @ p
- error Cannot read properties of undefined (reading '271')

kevinwolfcr avatar Aug 11 '23 04:08 kevinwolfcr

Hi @kevinwolfcr @shuding. Have you found any workaround on this?

dima-kov avatar Dec 02 '23 08:12 dima-kov

@dima-kov I fixed it using tw-to-css. Look at this two files:

  1. https://github.com/kevinwolfcr/website/blob/main/src/utils/ui/ui.utils.ts
  2. https://github.com/kevinwolfcr/website/blob/main/src/utils/og/og.utils.ts

kevinwolfcr avatar Dec 04 '23 12:12 kevinwolfcr