Skip to content

Instantly share code, notes, and snippets.

@claudia-romano
Last active November 8, 2017 10:27
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 claudia-romano/9aa3678b068e80646b4451d07b9cc00d to your computer and use it in GitHub Desktop.
Save claudia-romano/9aa3678b068e80646b4451d07b9cc00d to your computer and use it in GitHub Desktop.
.js .nc-button-wrapper {
position: relative;
}
.js .nc-button-wrapper input[type=radio],
.js .nc-button-wrapper input[type=checkbox] {
/* hide native checkbox and radio input if JavaScript is enabled */
position: absolute;
left: 0;
top: 0;
margin: 0;
padding: 0;
opacity: 0;
}
.nc-button-wrapper svg {
/* svg icon is hidden by default */
display: none;
}
.js .nc-button-wrapper svg {
/* show custom svg icon if JavaScript is enabled */
display: block;
position: absolute;
/* IE9 and IE10 support pointer-events on SVG elements while they don't support it on HTML elements */
pointer-events: none;
left: 0;
top: 50%;
-webkit-transform: translateY(-50%);
-ms-transform: translateY(-50%);
transform: translateY(-50%);
}
.js .nc-button-wrapper label {
position: relative;
padding-left: 20px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment