Reputation: 4407
To add dynamic class for body tag i used:
<body class="{{bodyClass}}"><!-- this remains uncompiled -->
{{bodyClass}} <!-- this renders to "blue" -->
</body>
and helper code:
Template.body.helpers({
bodyClass: function(){
return 'blue';
}
});
As result {{bodyClass}}
Inside body content is compiled to blue
as expected,
but the <body class="{{bodyClass}}">
remains uncompiled.
[edit] Ps. I'm using lates meteor 1.3
Upvotes: 0
Views: 152
Reputation: 1383
In the template right at the begging (or anywhere in the template really) you can simply do:
<style type="text/css">
body: blue;
</style>
Use !important if you need to.
Upvotes: 0
Reputation: 1178
Try onRendered with jQuery addClass
Template.templateName.onRendered(function (){
$('body').addClass('blue')
});
Upvotes: 1