From 4ea2e0ad56b18ca440a3278de5e6eb8068ca3ceb Mon Sep 17 00:00:00 2001 From: Mantas Miliukas Date: Tue, 9 Apr 2019 16:52:24 +0300 Subject: [PATCH] chore(styles): read css from a file --- assets/styles.css | 7 +++++++ src/email.js | 4 ++++ src/styles.css | 7 +++++++ 3 files changed, 18 insertions(+) create mode 100644 assets/styles.css create mode 100644 src/styles.css diff --git a/assets/styles.css b/assets/styles.css new file mode 100644 index 0000000..7eecf78 --- /dev/null +++ b/assets/styles.css @@ -0,0 +1,7 @@ +.red { + color: red; +} + +.blue { + color: blue; +} diff --git a/src/email.js b/src/email.js index 8452fab..4a8c95c 100644 --- a/src/email.js +++ b/src/email.js @@ -1,4 +1,5 @@ import React from 'react'; +import { readFileSync } from 'fs'; import { Mjml, @@ -14,12 +15,15 @@ import { MjmlText } from 'mjml-react'; +const css = readFileSync('./assets/styles.css').toString(); + export const generate = () => { return ( Last Minute Offer Last Minute Offer... + {css} {` .blue-column { background-color: blue; diff --git a/src/styles.css b/src/styles.css new file mode 100644 index 0000000..7eecf78 --- /dev/null +++ b/src/styles.css @@ -0,0 +1,7 @@ +.red { + color: red; +} + +.blue { + color: blue; +}