meteor - Multiple CSS style for the same template -
i have make user interface can run in dark or sunny places. so, want make "high contrast" theme , "normal theme".
i understood meteor merges , minify css files in 1 big stylesheet. so... wonder how switch between 2 theme, can't use tricks this site explains.
i have thought of solution : having super-class on body, contains colors definitions, switch little javascript. seems little rude.
any thought of better solution ?
if use less (an official meteor package), can define 2 different classes set on body (or main div), , give them different styles:
.dark { p { color: #fff; } /* dark styles... */ } .light { p { color: #000; } /* light styles... */ } then indeed, programmatically switch class on <body> or <div> tag, example using template.registerhelper , session class @adnan-y suggested.
it cleaner (plus use tons of cool less features lighten , darken), , compiled css on server run.
Comments
Post a Comment