Skip to content

Instantly share code, notes, and snippets.

@csssecrets
csssecrets / dabblet.css
Last active October 21, 2023 12:46
Parallelograms — with pseudoelements
/**
* Parallelograms — with pseudoelements
*/
.button {
position: relative;
display: inline-block;
padding: .5em 1em;
border: 0; margin: .5em;
background: transparent;
@csssecrets
csssecrets / dabblet.css
Last active January 17, 2023 16:27
Parallelograms — with extra HTML element
/**
* Parallelograms — with extra HTML element
*/
.button { transform: skewX(45deg); }
.button > div { transform: skewX(-45deg); }
.button {
display: inline-block;
padding: .5em 1em;
@csssecrets
csssecrets / dabblet.css
Last active February 21, 2023 18:30
Flexible quarter ellipse
/**
* Flexible quarter ellipse
*/
div {
display: inline-block;
width: 16em;
height: 10em;
margin: 1em;
background: #fb3;
@csssecrets
csssecrets / dabblet.css
Last active September 18, 2021 22:22
Flexible half ellipse
/**
* Flexible half ellipse
*/
div {
display: inline-block;
width: 16em;
height: 10em;
margin: 1em;
background: #fb3;
@csssecrets
csssecrets / dabblet.css
Last active September 18, 2021 20:34
Flexible ellipse
/**
* Flexible ellipse
*/
div {
width: 16em;
height: 10em;
background: #fb3;
border-radius: 50%;
}
@csssecrets
csssecrets / dabblet.css
Created January 23, 2015 06:21
Beveled corners — with clip-path
/**
* Beveled corners — with clip-path
*/
div {
background: #58a;
-webkit-clip-path:
polygon(20px 0, calc(100% - 20px) 0, 100% 20px, 100% calc(100% - 20px),
calc(100% - 20px) 100%,
20px 100%, 0 calc(100% - 20px), 0 20px);
@csssecrets
csssecrets / dabblet.css
Last active September 19, 2021 11:50
Beveled corners — with border-image and an inline SVG
/**
* Beveled corners — with border-image and an inline SVG
*/
div {
border: 21px solid transparent;
border-image: 1 url('data:image/svg+xml,\
<svg xmlns="http://www.w3.org/2000/svg" width="3" height="3" fill="%2358a">\
<polygon points="0,1 1,0 2,0 3,1 3,2 2,3 1,3 0,2" />\
</svg>');
@csssecrets
csssecrets / dabblet.css
Last active September 19, 2021 11:50
Beveled corners — with gradients
/**
* Beveled corners — with gradients
*/
div {
background: #58a;
background: linear-gradient(135deg, transparent 15px, #58a 0) top left,
linear-gradient(-135deg, transparent 15px, #58a 0) top right,
linear-gradient(-45deg, transparent 15px, #58a 0) bottom right,
linear-gradient(45deg, transparent 15px, #58a 0) bottom left;
@csssecrets
csssecrets / dabblet.css
Last active September 19, 2021 11:50
Scoop corners
/**
* Scoop corners
*/
div {
background: #58a;
background: radial-gradient(circle at top left, transparent 15px, #58a 0) top left,
radial-gradient(circle at top right, transparent 15px, #58a 0) top right,
radial-gradient(circle at bottom right, transparent 15px, #58a 0) bottom right,
radial-gradient(circle at bottom left, transparent 15px, #58a 0) bottom left;
@csssecrets
csssecrets / dabblet.css
Last active September 18, 2021 12:52
Checkerboard with SVG
/**
* Checkerboard with SVG
*/
background: #eee url('data:image/svg+xml,\
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" fill-opacity=".25" >\
<rect x="50" width="50" height="50" />\
<rect y="50" width="50" height="50" />\
</svg>');
background-size: 30px 30px;