Skip to content

Instantly share code, notes, and snippets.

@patrixd
Created June 24, 2017 11:53
Show Gist options
  • Save patrixd/a528eafe12b2d30b44de9629fbfa51aa to your computer and use it in GitHub Desktop.
Save patrixd/a528eafe12b2d30b44de9629fbfa51aa to your computer and use it in GitHub Desktop.
Playing with skew transformation
/**
* Playing with skew transformation */
.paralelogram {
color: hsl(359, 50%, 33%);
font-family: calibri, verdana;
position: relative;
padding: 0.5em 1.3em;
font-variant: small-caps;
margin: 0 1em;
width: 20%;
}
.paralelogram:before {
content: "";
position: absolute;
z-index: -1;
right: 0;
left: 0;
top: 0;
bottom: 0;
background: hsl(359, 50%, 33%);
transform: skew(-45deg);
}
.paralelogram:after {
content: "";
position: absolute;
z-index: -1;
right: .8em;
left: .8em;
top: .5em;
bottom: .5em;
background: hsla(359, 50%, 85%, .8);
transform: skew(-45deg);
}
<div class="paralelogram">Sometitle here</div>
// alert('Hello world!');
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment