-
Notifications
You must be signed in to change notification settings - Fork 825
feat(demo): use Tailwind v4 in slack-confirm.tsx #2492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
bukinoshita
wants to merge
17
commits into
canary
Choose a base branch
from
refactor/slack-with-tailwind
base: canary
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+378
−189
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
0604b50
chore(demo): tailwind basic setup
bukinoshita 1a7f9df
fix: minor tweak
bukinoshita f90893b
fix: minor tweak
bukinoshita 3fa21e5
fix errors
gabrielmfern 5f653b4
add tailwind config
gabrielmfern bd30439
use the new testing version
gabrielmfern 22ea3f7
update lock
gabrielmfern 9bafcd9
use pixelBasedPreset on tailwind config
gabrielmfern 0ce7170
update components
gabrielmfern 4060a59
sort
gabrielmfern e0847b7
sort
gabrielmfern 044e56a
update to next preview
gabrielmfern a8ebdfd
update components
gabrielmfern 4aa08f5
update lock
gabrielmfern e5fcfbf
refactor(demo): slack with tailwind
bukinoshita a7b0204
migrate slack-confirm.tsx to using tailwind v4
gabrielmfern a799c76
fix pixel differences
gabrielmfern File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -10,8 +10,10 @@ import { | |||||
Preview, | ||||||
Row, | ||||||
Section, | ||||||
Tailwind, | ||||||
Text, | ||||||
} from '@react-email/components'; | ||||||
import tailwindConfig from '../tailwind.config'; | ||||||
|
||||||
interface SlackConfirmEmailProps { | ||||||
validationCode?: string; | ||||||
|
@@ -26,121 +28,127 @@ export const SlackConfirmEmail = ({ | |||||
}: SlackConfirmEmailProps) => ( | ||||||
<Html> | ||||||
<Head /> | ||||||
<Body style={main}> | ||||||
<Preview>Confirm your email address</Preview> | ||||||
<Container style={container}> | ||||||
<Section style={logoContainer}> | ||||||
<Img | ||||||
src={`${baseUrl}/static/slack-logo.png`} | ||||||
width="120" | ||||||
height="36" | ||||||
alt="Slack" | ||||||
/> | ||||||
</Section> | ||||||
<Heading style={h1}>Confirm your email address</Heading> | ||||||
<Text style={heroText}> | ||||||
Your confirmation code is below - enter it in your open browser window | ||||||
and we'll help you get signed in. | ||||||
</Text> | ||||||
<Tailwind config={tailwindConfig}> | ||||||
<Body className="bg-white font-slack mx-auto my-0"> | ||||||
<Preview>Confirm your email address</Preview> | ||||||
<Container className="mx-auto my-0 py-0 px-5"> | ||||||
<Section className="mt-8"> | ||||||
<Img | ||||||
src={`${baseUrl}/static/slack-logo.png`} | ||||||
width="120" | ||||||
height="36" | ||||||
alt="Slack" | ||||||
/> | ||||||
</Section> | ||||||
<Heading className="text-[#1d1c1d] text-4xl font-bold my-7.5 mx-0 p-0 leading-10.5"> | ||||||
Confirm your email address | ||||||
</Heading> | ||||||
<Text className="text-xl mb-7.5"> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. mb-7.5 isn’t part of the Tailwind spacing scale from pixelBasedPreset, so this paragraph loses its bottom margin. Use an arbitrary value class like mb-[30px] instead. Prompt for AI agents
Suggested change
✅ Addressed in |
||||||
Your confirmation code is below - enter it in your open browser | ||||||
window and we'll help you get signed in. | ||||||
</Text> | ||||||
|
||||||
<Section style={codeBox}> | ||||||
<Text style={confirmationCodeText}>{validationCode}</Text> | ||||||
</Section> | ||||||
<Section className="bg-[rgb(245,244,245)] rounded mb-[30px] py-10 px-[10px]"> | ||||||
<Text className="text-3xl leading-[24px] text-center align-middle"> | ||||||
{validationCode} | ||||||
</Text> | ||||||
</Section> | ||||||
|
||||||
<Text style={text}> | ||||||
If you didn't request this email, there's nothing to worry about, you | ||||||
can safely ignore it. | ||||||
</Text> | ||||||
<Text className="text-black text-sm leading-6"> | ||||||
If you didn't request this email, there's nothing to worry about, | ||||||
you can safely ignore it. | ||||||
</Text> | ||||||
|
||||||
<Section> | ||||||
<Row style={footerLogos}> | ||||||
<Column style={{ width: '66%' }}> | ||||||
<Img | ||||||
src={`${baseUrl}/static/slack-logo.png`} | ||||||
width="120" | ||||||
height="36" | ||||||
alt="Slack" | ||||||
/> | ||||||
</Column> | ||||||
<Column align="right"> | ||||||
<Link href="/"> | ||||||
<Img | ||||||
src={`${baseUrl}/static/slack-twitter.png`} | ||||||
width="32" | ||||||
height="32" | ||||||
alt="Slack" | ||||||
style={socialMediaIcon} | ||||||
/> | ||||||
</Link> | ||||||
<Link href="/"> | ||||||
<Section> | ||||||
<Row className="mb-8 pl-2 pr-2"> | ||||||
<Column className="w-2/3"> | ||||||
<Img | ||||||
src={`${baseUrl}/static/slack-facebook.png`} | ||||||
width="32" | ||||||
height="32" | ||||||
src={`${baseUrl}/static/slack-logo.png`} | ||||||
width="120" | ||||||
height="36" | ||||||
alt="Slack" | ||||||
style={socialMediaIcon} | ||||||
/> | ||||||
</Link> | ||||||
<Link href="/"> | ||||||
<Img | ||||||
src={`${baseUrl}/static/slack-linkedin.png`} | ||||||
width="32" | ||||||
height="32" | ||||||
alt="Slack" | ||||||
style={socialMediaIcon} | ||||||
/> | ||||||
</Link> | ||||||
</Column> | ||||||
</Row> | ||||||
</Section> | ||||||
|
||||||
<Section> | ||||||
<Link | ||||||
style={footerLink} | ||||||
href="https://slackhq.com" | ||||||
target="_blank" | ||||||
rel="noopener noreferrer" | ||||||
> | ||||||
Our blog | ||||||
</Link> | ||||||
| | ||||||
<Link | ||||||
style={footerLink} | ||||||
href="https://slack.com/legal" | ||||||
target="_blank" | ||||||
rel="noopener noreferrer" | ||||||
> | ||||||
Policies | ||||||
</Link> | ||||||
| | ||||||
<Link | ||||||
style={footerLink} | ||||||
href="https://slack.com/help" | ||||||
target="_blank" | ||||||
rel="noopener noreferrer" | ||||||
> | ||||||
Help center | ||||||
</Link> | ||||||
| | ||||||
<Link | ||||||
style={footerLink} | ||||||
href="https://slack.com/community" | ||||||
target="_blank" | ||||||
rel="noopener noreferrer" | ||||||
data-auth="NotApplicable" | ||||||
data-linkindex="6" | ||||||
> | ||||||
Slack Community | ||||||
</Link> | ||||||
<Text style={footerText}> | ||||||
©2022 Slack Technologies, LLC, a Salesforce company. <br /> | ||||||
500 Howard Street, San Francisco, CA 94105, USA <br /> | ||||||
<br /> | ||||||
All rights reserved. | ||||||
</Text> | ||||||
</Section> | ||||||
</Container> | ||||||
</Body> | ||||||
</Column> | ||||||
<Column align="right"> | ||||||
<Link href="/"> | ||||||
<Img | ||||||
src={`${baseUrl}/static/slack-twitter.png`} | ||||||
width="32" | ||||||
height="32" | ||||||
alt="Slack" | ||||||
className="inline ml-2" | ||||||
/> | ||||||
</Link> | ||||||
<Link href="/"> | ||||||
<Img | ||||||
src={`${baseUrl}/static/slack-facebook.png`} | ||||||
width="32" | ||||||
height="32" | ||||||
alt="Slack" | ||||||
className="inline ml-2" | ||||||
/> | ||||||
</Link> | ||||||
<Link href="/"> | ||||||
<Img | ||||||
src={`${baseUrl}/static/slack-linkedin.png`} | ||||||
width="32" | ||||||
height="32" | ||||||
alt="Slack" | ||||||
className="inline ml-2" | ||||||
/> | ||||||
</Link> | ||||||
</Column> | ||||||
</Row> | ||||||
</Section> | ||||||
|
||||||
<Section> | ||||||
<Link | ||||||
className="text-[#b7b7b7] underline" | ||||||
href="https://slackhq.com" | ||||||
target="_blank" | ||||||
rel="noopener noreferrer" | ||||||
> | ||||||
Our blog | ||||||
</Link> | ||||||
| | ||||||
<Link | ||||||
className="text-[#b7b7b7] underline" | ||||||
href="https://slack.com/legal" | ||||||
target="_blank" | ||||||
rel="noopener noreferrer" | ||||||
> | ||||||
Policies | ||||||
</Link> | ||||||
| | ||||||
<Link | ||||||
className="text-[#b7b7b7] underline" | ||||||
href="https://slack.com/help" | ||||||
target="_blank" | ||||||
rel="noopener noreferrer" | ||||||
> | ||||||
Help center | ||||||
</Link> | ||||||
| | ||||||
<Link | ||||||
className="text-[#b7b7b7] underline" | ||||||
href="https://slack.com/community" | ||||||
target="_blank" | ||||||
rel="noopener noreferrer" | ||||||
data-auth="NotApplicable" | ||||||
data-linkindex="6" | ||||||
> | ||||||
Slack Community | ||||||
</Link> | ||||||
<Text className="text-xs leading-[15px] text-left mb-[50px] text-[#b7b7b7]"> | ||||||
©2022 Slack Technologies, LLC, a Salesforce company. <br /> | ||||||
500 Howard Street, San Francisco, CA 94105, USA <br /> | ||||||
<br /> | ||||||
All rights reserved. | ||||||
</Text> | ||||||
</Section> | ||||||
</Container> | ||||||
</Body> | ||||||
</Tailwind> | ||||||
</Html> | ||||||
); | ||||||
|
||||||
|
@@ -150,76 +158,3 @@ SlackConfirmEmail.PreviewProps = { | |||||
|
||||||
export default SlackConfirmEmail; | ||||||
|
||||||
const footerText = { | ||||||
fontSize: '12px', | ||||||
color: '#b7b7b7', | ||||||
lineHeight: '15px', | ||||||
textAlign: 'left' as const, | ||||||
marginBottom: '50px', | ||||||
}; | ||||||
|
||||||
const footerLink = { | ||||||
color: '#b7b7b7', | ||||||
textDecoration: 'underline', | ||||||
}; | ||||||
|
||||||
const footerLogos = { | ||||||
marginBottom: '32px', | ||||||
paddingLeft: '8px', | ||||||
paddingRight: '8px', | ||||||
}; | ||||||
|
||||||
const socialMediaIcon = { | ||||||
display: 'inline', | ||||||
marginLeft: '8px', | ||||||
}; | ||||||
|
||||||
const main = { | ||||||
backgroundColor: '#ffffff', | ||||||
margin: '0 auto', | ||||||
fontFamily: | ||||||
"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif", | ||||||
}; | ||||||
|
||||||
const container = { | ||||||
margin: '0 auto', | ||||||
padding: '0px 20px', | ||||||
}; | ||||||
|
||||||
const logoContainer = { | ||||||
marginTop: '32px', | ||||||
}; | ||||||
|
||||||
const h1 = { | ||||||
color: '#1d1c1d', | ||||||
fontSize: '36px', | ||||||
fontWeight: '700', | ||||||
margin: '30px 0', | ||||||
padding: '0', | ||||||
lineHeight: '42px', | ||||||
}; | ||||||
|
||||||
const heroText = { | ||||||
fontSize: '20px', | ||||||
lineHeight: '28px', | ||||||
marginBottom: '30px', | ||||||
}; | ||||||
|
||||||
const codeBox = { | ||||||
background: 'rgb(245, 244, 245)', | ||||||
borderRadius: '4px', | ||||||
marginBottom: '30px', | ||||||
padding: '40px 10px', | ||||||
}; | ||||||
|
||||||
const confirmationCodeText = { | ||||||
fontSize: '30px', | ||||||
textAlign: 'center' as const, | ||||||
verticalAlign: 'middle', | ||||||
}; | ||||||
|
||||||
const text = { | ||||||
color: '#000', | ||||||
fontSize: '14px', | ||||||
lineHeight: '24px', | ||||||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { pixelBasedPreset, type TailwindConfig } from '@react-email/components'; | ||
|
||
export default { | ||
presets: [pixelBasedPreset], | ||
theme: { | ||
fontFamily: { | ||
slack: | ||
"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif", | ||
}, | ||
}, | ||
} satisfies TailwindConfig; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,15 +9,15 @@ | |
"export": "email-dev export" | ||
}, | ||
"dependencies": { | ||
"@react-email/components": "workspace:*", | ||
"@react-email/components": "npm:@react-email/[email protected]", | ||
"email-dev": "workspace:*", | ||
"react": "^19", | ||
"react-dom": "^19", | ||
"email-dev": "workspace:*" | ||
"react-dom": "^19" | ||
}, | ||
"devDependencies": { | ||
"@react-email/preview-server": "workspace:*", | ||
"next": "^15.3.2", | ||
"@types/react": "^19", | ||
"@types/react-dom": "^19" | ||
"@types/react-dom": "^19", | ||
"next": "^15.3.2" | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Tailwind preset backing this email doesn’t define my-7.5 or leading-10.5, so this heading renders without the intended spacing/line-height. Replace them with arbitrary values (e.g., my-[30px], leading-[42px]) so the styles survive compilation.
Prompt for AI agents