Skip to content

Instantly share code, notes, and snippets.

@jamesfoster
Created June 23, 2010 23:28
Show Gist options
  • Save jamesfoster/450728 to your computer and use it in GitHub Desktop.
Save jamesfoster/450728 to your computer and use it in GitHub Desktop.

in your html

<link rel="stylesheet"  src="site.less?browser=ie" />

site.less

.opacity(@alpha: 100) {
  .opacity(@browser, @alpha);
}
.opacity(ie, @alpha) {
  filter: alpha(opacity=@alpha);
}
.opacity(ff, @alpha) {
  opacity: @alpha / 100;
}

Now to use that elsewhere in your less file:

#header {
  .opacity(50);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment