Skip to content

Commit

Permalink
chore(styles): read css from a file
Browse files Browse the repository at this point in the history
  • Loading branch information
mastertheblaster committed Apr 9, 2019
1 parent 90f32d1 commit 4ea2e0a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
7 changes: 7 additions & 0 deletions assets/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.red {
color: red;
}

.blue {
color: blue;
}
4 changes: 4 additions & 0 deletions src/email.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import { readFileSync } from 'fs';

import {
Mjml,
Expand All @@ -14,12 +15,15 @@ import {
MjmlText
} from 'mjml-react';

const css = readFileSync('./assets/styles.css').toString();

export const generate = () => {
return (
<Mjml>
<MjmlHead>
<MjmlTitle>Last Minute Offer</MjmlTitle>
<MjmlPreview>Last Minute Offer...</MjmlPreview>
<MjmlStyle>{css}</MjmlStyle>
<MjmlStyle>{`
.blue-column {
background-color: blue;
Expand Down
7 changes: 7 additions & 0 deletions src/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.red {
color: red;
}

.blue {
color: blue;
}

0 comments on commit 4ea2e0a

Please sign in to comment.