Skip to content
This repository was archived by the owner on Jun 22, 2024. It is now read-only.

Commit 5242436

Browse files
authored
Merge pull request #24 from vue-email/feat/tailwind-config
feat: load tailwind config
2 parents d481220 + 1e2ea72 commit 5242436

File tree

9 files changed

+298
-183
lines changed

9 files changed

+298
-183
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050
"dependencies": {
5151
"@nuxt/kit": "^3.10.0",
5252
"defu": "^6.1.4",
53-
"vue-email": "^0.8.7",
54-
"@vue-email/compiler": "^0.8.9",
53+
"vue-email": "npm:vue-email-edge@0.8.7-28446842.1f6e4a0",
54+
"@vue-email/compiler": "npm:@vue-email/compiler-edge@0.8.9-28446863.0aab8eb",
5555
"sirv": "^2.0.4"
5656
},
5757
"devDependencies": {
Lines changed: 114 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -1,156 +1,144 @@
11
<script setup lang="ts">
2-
const main = {
3-
backgroundColor: '#f6f9fc',
4-
fontFamily: '-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Ubuntu,sans-serif',
2+
interface Props {
3+
invitedByUsername?: string;
4+
teamName?: string;
5+
username?: string;
6+
invitedByEmail?: string;
7+
inviteLink?: string;
8+
inviteFromIp?: string;
9+
inviteFromLocation?: string;
510
}
611
7-
const container = {
8-
backgroundColor: '#ffffff',
9-
margin: '0 auto',
10-
padding: '20px 0 48px',
11-
marginBottom: '64px',
12-
}
13-
14-
const box = {
15-
padding: '0 48px',
16-
}
17-
18-
const hr = {
19-
borderColor: '#e6ebf1',
20-
margin: '20px 0',
21-
}
22-
23-
const paragraph = {
24-
color: '#525f7f',
12+
const props = withDefaults(defineProps<Props>(), {
13+
teamName: "My project",
14+
username: "John Doe",
15+
invitedByEmail: "anpch@example.com",
16+
inviteLink: "https://vercel.com/teams/invite/foo",
17+
inviteFromIp: "172.0.0.1",
18+
inviteFromLocation: "San Francisco, CA",
19+
});
2520
26-
fontSize: '16px',
27-
lineHeight: '24px',
28-
textAlign: 'left',
29-
}
30-
31-
const anchor = {
32-
color: '#556cd6',
33-
}
34-
35-
const button = {
36-
backgroundColor: '#656ee8',
37-
borderRadius: '5px',
38-
color: '#fff',
39-
fontSize: '16px',
40-
fontWeight: 'bold',
41-
textDecoration: 'none',
42-
textAlign: 'center',
43-
display: 'block',
44-
width: '100%',
45-
}
46-
47-
const footer = {
48-
color: '#8898aa',
49-
fontSize: '12px',
50-
lineHeight: '16px',
51-
}
52-
53-
const code = `import { codeToThemedTokens } from 'shikiji'
21+
const previewText = `Join ${props.invitedByUsername} on Vercel`;
5422
23+
const code = `import { codeToThemedTokens } from 'shiki'
5524
const tokens = await codeToThemedTokens('<div class="foo">bar</div>', {
5625
lang: 'html',
5726
theme: 'min-dark'
5827
})
59-
`
28+
`;
6029
</script>
6130

6231
<template>
63-
<EHtml>
64-
<EHead />
65-
<EPreview>You're now ready to make live transactions with Stripe!</EPreview>
66-
<EBody :style="main">
67-
<EContainer :style="container">
68-
<ESection :style="box">
69-
<EImg
70-
src="/static/stripe-logo.png"
71-
width="49"
72-
height="21"
73-
alt="Stripe"
74-
/>
75-
<EHr :style="hr" />
76-
<EText :style="paragraph">
77-
Thanks for submitting your account information. You're now ready to make live transactions with Stripe!
32+
<ETailwind>
33+
<EHtml>
34+
<EHead>
35+
<EStyle>
36+
.pager {display: none;} @media only screen and (max-width: 480px) {
37+
.pager {display: block;} }
38+
</EStyle>
39+
</EHead>
40+
<EPreview>{{ previewText }}</EPreview>
41+
<EBody class="bg-primary my-auto mx-auto font-sans">
42+
<EContainer
43+
class="border border-solid border-[#eaeaea] p-[20px] md:p-20 rounded my-[40px] mx-auto max-w-[465px]"
44+
>
45+
<ESection class="mt-[32px] pager">
46+
<EImg
47+
src="/static/vercel-logo.png"
48+
width="40"
49+
height="37"
50+
alt="Vercel"
51+
class="my-0 mx-auto"
52+
/>
53+
</ESection>
54+
<EHeading
55+
class="text-black text-[24px] font-normal text-center p-0 my-[30px] mx-0"
56+
>
57+
Join <strong>{{ teamName }}</strong> on <strong>Vercel</strong>
58+
</EHeading>
59+
<EText class="text-black text-[14px] leading-[24px]">
60+
Hello {{ username }},
7861
</EText>
79-
<EText :style="paragraph">
80-
You can view your payments and a variety of other information about your account right from your dashboard.
62+
<EText class="text-black text-[14px] leading-[24px]">
63+
{{ $vueEmail.baseUrl }}
8164
</EText>
82-
<EButton
83-
px="10"
84-
py="10"
85-
:style="button"
86-
href="https://dashboard.stripe.com/login"
87-
>
88-
View your Stripe Dashboard
89-
</EButton>
90-
<EHr :style="hr" />
91-
<EText :style="paragraph">
92-
If you haven't finished your integration, you might find our
65+
<EText class="text-black text-[14px] leading-[24px]">
66+
<strong>bukinoshita</strong> (
9367
<ELink
94-
:style="anchor"
95-
href="https://stripe.com/docs"
68+
:href="`mailto:${invitedByEmail}`"
69+
class="text-blue-600 no-underline"
9670
>
97-
docs
71+
{{ invitedByEmail }}
9872
</ELink>
99-
handy.
73+
) has invited you to the <strong>{{ teamName }}</strong> team on
74+
<strong>Vercel</strong>.
10075
</EText>
10176
<ECodeBlock
102-
style="padding: 20px;"
77+
class="p-5"
10378
:code="code"
10479
lang="typescript"
10580
theme="min-dark"
10681
/>
107-
<EText :style="paragraph">
108-
Once you're ready to start accepting payments, you'll just need to use your live
109-
<ELink
110-
:style="anchor"
111-
href="https://dashboard.stripe.com/login?redirect=%2Fapikeys"
112-
>
113-
API keys
114-
</ELink>
115-
instead of your test API keys. Your account can simultaneously be used for both test and live requests, so you can continue testing while accepting live payments. Check
116-
out our
117-
<ELink
118-
:style="anchor"
119-
href="https://stripe.com/docs/dashboard"
120-
>
121-
tutorial about account basics
122-
</ELink>
123-
.
124-
</EText>
125-
<EText :style="paragraph">
126-
Finally, we've put together a
127-
<ELink
128-
:style="anchor"
129-
href="https://stripe.com/docs/checklist/website"
82+
<ESection>
83+
<ERow>
84+
<EColumn align="right">
85+
<EImg
86+
class="rounded-full"
87+
src="/static/vercel-user.png"
88+
width="64"
89+
height="64"
90+
/>
91+
</EColumn>
92+
<EColumn align="center">
93+
<EImg
94+
src="/static/vercel-arrow.png"
95+
width="12"
96+
height="9"
97+
alt="invited you to"
98+
/>
99+
</EColumn>
100+
<EColumn align="left">
101+
<EImg
102+
class="rounded-full"
103+
src="/static/vercel-team.png"
104+
width="64"
105+
height="64"
106+
/>
107+
</EColumn>
108+
</ERow>
109+
</ESection>
110+
<ESection class="text-center mt-[32px] mb-[32px]">
111+
<EButton
112+
px="20"
113+
py="12"
114+
class="bg-[#000000] rounded text-white text-[12px] font-semibold no-underline text-center"
115+
:href="inviteLink"
130116
>
131-
quick checklist
132-
</ELink>
133-
to ensure your website conforms to card network standards.
134-
</EText>
135-
<EText :style="paragraph">
136-
We'll be here to help you with any step along the way. You can find answers to most questions and get in touch with us on our
117+
Join the team
118+
</EButton>
119+
</ESection>
120+
<EText class="text-black text-[14px] leading-[24px]">
121+
or copy and paste this URL into your browser:
137122
<ELink
138-
:style="anchor"
139-
href="https://support.stripe.com/"
123+
:href="inviteLink"
124+
class="text-blue-600 no-underline"
140125
>
141-
support site
126+
{{ inviteLink }}
142127
</ELink>
143-
.
144-
</EText>
145-
<EText :style="paragraph">
146-
— The Stripe team
147128
</EText>
148-
<EHr :style="hr" />
149-
<EText :style="footer">
150-
Stripe, 354 Oyster Point Blvd, South San Francisco, CA 94080
129+
<EHr
130+
class="border border-solid border-[#eaeaea] my-[26px] mx-0 w-full"
131+
/>
132+
<EText class="text-[#666666] text-[12px] leading-[24px]">
133+
This invitation was intended for
134+
<span class="text-black">{{ username }} </span>.This invite was sent
135+
from <span class="text-black">{{ inviteFromIp }}</span> located in
136+
<span class="text-black">{{ inviteFromLocation }}</span>. If you were not expecting this invitation, you can ignore this
137+
email. If you are concerned about your account's safety, please
138+
reply to this email to get in touch with us.
151139
</EText>
152-
</ESection>
153-
</EContainer>
154-
</EBody>
155-
</EHtml>
140+
</EContainer>
141+
</EBody>
142+
</EHtml>
143+
</ETailwind>
156144
</template>

playground/nuxt.config.ts

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,36 @@
11
export default defineNuxtConfig({
2-
modules: ['../src/module'],
3-
extends: [
4-
'./nuxt-layer'
5-
],
2+
modules: ["../src/module", "@nuxtjs/tailwindcss"],
3+
extends: ["./nuxt-layer"],
64
vueEmail: {
7-
baseUrl: 'https://vue-email-demo.vercel.app/',
5+
baseUrl: "https://vue-email-demo.vercel.app/",
86
i18n: {
9-
defaultLocale: 'fr',
7+
defaultLocale: "fr",
108
translations: {
119
en: {
12-
title: 'Welcome to Vue Email',
13-
subtitle: 'A Vue.js component for generating beautiful emails using MJML',
14-
button: 'Get Started',
10+
title: "Welcome to Vue Email",
11+
subtitle:
12+
"A Vue.js component for generating beautiful emails using MJML",
13+
button: "Get Started",
1514
},
1615
fr: {
17-
title: 'Bienvenue sur Vue Email',
18-
subtitle: 'Un composant Vue.js pour générer de beaux emails en utilisant MJML',
19-
button: 'Commencer',
16+
title: "Bienvenue sur Vue Email",
17+
subtitle:
18+
"Un composant Vue.js pour générer de beaux emails en utilisant MJML",
19+
button: "Commencer",
2020
},
2121
},
2222
},
23-
autoImport: false
23+
autoImport: false,
24+
// tailwind: {
25+
// theme: {
26+
// extend: {
27+
// colors: {
28+
// primary: "#ea580c",
29+
// secondary: "#ca8a04",
30+
// },
31+
// },
32+
// },
33+
// },
2434
},
2535
devtools: { enabled: true },
26-
27-
})
36+
});

playground/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"analyze": "nuxt analyze"
1111
},
1212
"devDependencies": {
13+
"@nuxtjs/tailwindcss": "^6.11.2",
1314
"nuxt": "latest"
1415
}
1516
}

playground/server/api/test.get.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
1-
import { useCompiler } from '#vue-email'
1+
import { useCompiler } from "#vue-email";
22

33
export default defineEventHandler(async () => {
44
try {
5-
const template = await useCompiler('TestEmail.vue', {
5+
const template = await useCompiler("TestEmail.vue", {
66
props: {
7-
username: 'Flowko',
7+
username: "Flowko",
88
},
99
}).catch((error) => {
1010
console.error(error);
11-
})
11+
});
1212

13-
if(!template) return null
13+
if (!template) return null;
1414

15-
return template.html
15+
return template.html;
1616
} catch (error) {
1717
console.error(error);
18-
1918
}
20-
})
19+
});

playground/tailwind.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/** @type {import('tailwindcss').Config} */
2+
export default {
3+
content: [],
4+
theme: {
5+
extend: {
6+
colors: {
7+
primary: "cyan",
8+
secondary: "#ca8a04",
9+
},
10+
},
11+
},
12+
plugins: [],
13+
};

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy