leemunroe / grunt-email-workflow

A Grunt workflow for designing and testing responsive HTML email templates with SCSS.
MIT License
3.05k stars 339 forks source link

support specific style file for different layout #107

Closed irvin closed 4 years ago

irvin commented 4 years ago

It's easy to add new layout, but I don't find a way to assign different style for each layouts, that make it difficult to manage multiple functional email in one place.

taeo commented 4 years ago

Hey @irvin

We've got your back - it's setup to support as many unique or shared styles as you'd like.

  1. Create a new scss filesrc/css/scss/layout_b.scss for example. @import whatever shared styles or unique styles you'd like.
  2. Edit grunt/sass.js and add reference to your new scss file.
    files: {
    '<%= paths.src %>/css/main.css': '<%= paths.src %>/css/scss/main.scss',
    '<%= paths.src %>/css/layout_b.css': '<%= paths.src %>/css/scss/layout_b.scss'
    }
  3. Create your new layout src/layouts/layout_b.hbs and change the stylesheet reference.
    <link href="../src/css/layout_b.css" media="all" rel="stylesheet" type="text/css" />
irvin commented 4 years ago

Thanks a lot!

I think this may go into document?