Conditionally include css files with meteor

meteor

Solution

Meteor doesn't allow (currently) helpers inside the tag.

Rapid way: wrap all your content inside a div with an #id an then use stylus to wrap all the css rules ander that tag:

#myPagewrap1
  #row
    some: rule

#myPagewrap1
  #row
    some: rule

Long way: attach some dynamic css call to the .created method of your template.

Template.myPage.created = function(){
  loadStyle("pathtostyle.css");
}

And your loadStyle function could be something like this: http://www.javascriptkit.com/javatutors/loadjavascriptcss.shtml

Problem

I am making a "multipage" app with meteor and would like to use different css files per page. Is this possible?

Original source