vercel / satori

Enlightened library to convert HTML and CSS to SVG
https://og-playground.vercel.app
Mozilla Public License 2.0
11.09k stars 246 forks source link

Access to custom Tailwind config through `ImageResponse` #503

Open shuding opened 1 year ago

shuding commented 1 year ago
          @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

kevinwolfcr commented 1 year ago

@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/@shuding+opentype.js@1.4.0-beta.0/node_modules/@shuding/opentype.js/dist/opentype.module.js (10279:22) @ p
- error Cannot read properties of undefined (reading '271')
dima-kov commented 11 months ago

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

kevinwolfcr commented 11 months ago

@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