Skip to content

Commit

Permalink
Merge pull request #83 from flexbox/tailwindOgImage
Browse files Browse the repository at this point in the history
Tailwind for og:image
  • Loading branch information
flexbox committed Feb 22, 2023
2 parents d2712fc + de0e37f commit a2bcd3e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 24 deletions.
28 changes: 4 additions & 24 deletions apps/weshipit/pages/api/og.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,36 +14,16 @@ export default function handler(req: NextRequest) {

return new ImageResponse(
(
<div
style={{
backgroundColor: '#f3f4f6',
height: '100%',
width: '100%',
textAlign: 'center',
alignItems: 'center',
display: 'flex',
justifyContent: 'center',
flexDirection: 'column',
}}
>
<div
style={{
display: 'flex',
position: 'absolute',
bottom: 0,
right: 0,
padding: 16,
}}
>
<div className="flex h-full w-full flex-col items-center justify-center bg-white text-center">
<div className="absolute bottom-0 right-0 flex p-4">
{/* eslint-disable-next-line @next/next/no-img-element */}
<img
alt="weshipit.today - logo"
height={96}
src="https://raw.githubusercontent.com/flexbox/weshipit.today/main/apps/weshipit/public/android-chrome-192x192.png"
width={96}
className="h-24 w-24"
/>
</div>
<div style={{ fontSize: '64px', fontWeight: 'bolder' }}>{title}</div>
<div className="font-inter text-5xl">{title}</div>
</div>
),
{
Expand Down
3 changes: 3 additions & 0 deletions apps/weshipit/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ module.exports = {
...createGlobPatternsForDependencies(__dirname),
],
theme: {
fontFamily: {
inter: ['Inter', 'sans-serif'],
},
extend: {
animation: {
shine: 'shine 1s',
Expand Down

2 comments on commit a2bcd3e

@vercel
Copy link

@vercel vercel bot commented on a2bcd3e Feb 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on a2bcd3e Feb 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.