Skip to content

Instantly share code, notes, and snippets.

@cfxd
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cfxd/bbbb73e0051d1204dfa5 to your computer and use it in GitHub Desktop.
Save cfxd/bbbb73e0051d1204dfa5 to your computer and use it in GitHub Desktop.
LESS Mixin to change selection color
.selection(@color; @bg) {
&::selection {
-webkit-font-smoothing: antialiased;
color: @color;
text-shadow: none;
background: @bg;
background: fadeout(@bg, 1%);
}
&::-moz-selection {
-webkit-font-smoothing: antialiased;
color: @color;
text-shadow: none;
background: @bg;
background: fadeout(@bg, 1%);
}
}
//control body select
.selection(#fff; #000);
//override element
.element {
.selection(#000; #fff);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment