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

Commit a98effa

Browse files
committed
Merge pull request #35 from lookback/fix/remove-sass-dep
Make node-sass opt in.
2 parents 1ba0ccb + 78d9635 commit a98effa

File tree

7 files changed

+25
-5
lines changed

7 files changed

+25
-5
lines changed

.versions

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ iron:[email protected]
2323
2424
2525
26-
26+
2727
2828
meteorhacks:[email protected]
2929

README.md

+10
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Usually, building HTML emails yourself is tedious. On top of that, add the need
88

99
- **Server side rendering** with the [Meteor SSR](https://github.com/meteorhacks/meteor-ssr/) package. Use Blaze features and helpers like on the client.
1010
- **CSS inlining** with [Juice](http://npmjs.org/package/juice). No extra build step.
11+
- **SCSS support** using `node-sass` (opt-in).
1112
- **Preview and debug** emails in development mode in your browser when developing.
1213
- **Layouts** for re-using markup.
1314

@@ -25,6 +26,14 @@ meteor add lookback:emails
2526

2627
A `Mailer` global will exported on the *server*.
2728

29+
**Notice.** If you want SCSS support, be sure to add the `[meteor-node-sass](https://github.com/chrisbutler/meteor-node-sass)` package to your app:
30+
31+
```
32+
meteor add chrisbutler:node-sass
33+
```
34+
35+
`lookback:emails` will automatically detect `node-sass` being available, and will be able to compile `.scss` files.
36+
2837
## Sample app
2938

3039
There is a sample application in this repo, in the `example` directory. Boot it up, and preview an email with:
@@ -410,6 +419,7 @@ Why not try [`meteor-logger`](https://github.com/lookback/meteor-logger)? :)
410419

411420
## Version history
412421

422+
- `0.5.0` - Remove `node-sass` as hard dependency. SCSS support is now opt-in, by adding `chrisbutler:node-sass` to your app.
413423
- `0.4.6` - Fix paths on Windows in development mode.
414424
- `0.4.5`
415425
- CSS and SCSS is now compiled and inlined at runtime, in order to inline CSS for the rendered content. If CSS only was inlined at compile time, the dynamic content wouldn't get any styling.

example/.meteor/packages

+1
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ meteor-platform
88
autopublish
99
insecure
1010
lookback:emails
11+
chrisbutler:[email protected]

example/.meteor/versions

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ [email protected]
3333
3434
3535
36-
lookback:emails@0.4.5
36+
lookback:emails@0.5.0
3737
3838
3939
meteorhacks:[email protected]

example/private/layout.scss

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
$color: #333;
2+
13
body, p {
24
font-family: sans-serif;
3-
color: #333;
5+
color: $color;
46
text-align: center;
57
}

package.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,22 @@ var where = 'server';
33
Package.describe({
44
name: 'lookback:emails',
55
summary: 'Send HTML emails with server side Blaze templates. Preview and debug in the browser.',
6-
version: '0.4.6',
6+
version: '0.5.0',
77
git: 'https://github.com/lookback/meteor-emails.git'
88
});
99

1010
Package.onUse(function(api) {
1111

1212
api.versionsFrom('1.0.4');
1313

14+
api.use('chrisbutler:[email protected]', where, { weak: true });
15+
1416
api.use([
1517
'check',
1618
'underscore',
1719
'coffeescript',
1820
'email',
1921
20-
'chrisbutler:[email protected]',
2122
2223
'meteorhacks:[email protected]'
2324
], where);

utils.coffee

+6
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,13 @@ Utils =
103103

104104
# Take a path to a SCSS file and compiles it to CSS with `node-sass`.
105105
toCSS: (scss) ->
106+
if !Package['chrisbutler:node-sass']
107+
Utils.Logger.warn 'Sass support is opt-in since lookback:[email protected]. Please add chrisbutler:node-sass from Atmosphere and try again.', TAG
108+
# Return file contents.
109+
return Utils.readFile(scss)
110+
106111
file = path.join(ROOT, scss)
112+
sass = Package['chrisbutler:node-sass'].sass
107113

108114
try
109115
return sass.renderSync(file: file, sourceMap: false).css.toString()

0 commit comments

Comments
 (0)