nitkkr-dev / nitkkr

This repo contains both the front-end and back-end code for NITKKR's new website
https://nitkkr-dev.vercel.app
14 stars 2 forks source link

Dynamically pass banner image URL to <ImageHeader /> #128

Closed GetPsyched closed 6 months ago

GetPsyched commented 6 months ago

Currently, <ImageHeader /> sets its background by taking in a className prop with a Tailwind class like bg-[url('https://foo.bar')] but we want this to be dynamic. For some reason, Tailwind doesn't read dynamically passed URLs like bg-[url(${someUrlVariable})].

heydoyouknowme0 commented 6 months ago

Tailwind cannot build dynamic classes, just using style tag for this should be fine I think

heydoyouknowme0 commented 6 months ago

https://github.com/kiahjh/next-bg-image