Conditionally apply css rules


Is it possible to conditionally apply CSS rules in the user’s styles.less stylesheet based on what theme is currently loaded? In other words, is there a way to setup my styles.less file so that a certain set of css rules gets applied only when a particular syntax theme is loaded? If so, how would this be done?


The atom-workspace element at the top of the DOM always has classes according to the active themes. You should open the developer tools (View -> Developer -> Toggle developer tools) and take a look at it.


Thanks for the advice. I poked around in there and, sure enough, I saw some classes/variables I could use.