Skip to content

Instantly share code, notes, and snippets.

@asiviero
Created July 22, 2014 21:56
Show Gist options
  • Save asiviero/9a54363f1c7cabdafc4c to your computer and use it in GitHub Desktop.
Save asiviero/9a54363f1c7cabdafc4c to your computer and use it in GitHub Desktop.
Skewing Bootstrap buttons with a little help from jQuery
/* Skew the button */
.btn {
transform: rotate(15deg);
-ms-transform: rotate(15deg); /* IE 9 */
-webkit-transform: rotate(15deg); /* Opera, Chrome, and Safari */
}
/* Skew back its contents */
.btn .to-skew {
transform: rotate(-15deg);
-ms-transform: rotate(-15deg); /* IE 9 */
-webkit-transform: rotate(-15deg); /* Opera, Chrome, and Safari */
}
(function($) {
// Wrap every button content
$('.btn').wrapInner('<div class="to-skew"></div>');
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment