Created
July 22, 2014 21:56
-
-
Save asiviero/9a54363f1c7cabdafc4c to your computer and use it in GitHub Desktop.
Skewing Bootstrap buttons with a little help from jQuery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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 */ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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