Skip to content

Instantly share code, notes, and snippets.

@nathos
Last active April 3, 2020 23:44
Show Gist options
  • Save nathos/4611077 to your computer and use it in GitHub Desktop.
Save nathos/4611077 to your computer and use it in GitHub Desktop.
Sass (SCSS) mixin to disable user-select on an element
@mixin no-select {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
@paulovicmichal
Copy link

Great, it works for me! Thanks.

@mflisikowski
Copy link

-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;

-webkit-touch-callout: none;
-ms-text-size-adjust: none;
-webkit-text-size-adjust: none;
-webkit-tap-highlight-color: rgba(0,0,0,0);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment