Skip to content

Instantly share code, notes, and snippets.

@ffoodd
Forked from anonymous/dabblet.css
Created February 16, 2016 09:30
Show Gist options
  • Save ffoodd/b0fe9ab6924715d2d1a9 to your computer and use it in GitHub Desktop.
Save ffoodd/b0fe9ab6924715d2d1a9 to your computer and use it in GitHub Desktop.
Dégradés
/**
* Dégradés
* Je voudrais que les motifs avec les petits points se répète sur le triangle qui déborde.
* Je m'y prends très mal, Help :D
*/
:root {
font-family: sans-serif;
}
body {
min-height: 100vh;
}
h1 {
position: relative;
z-index: 3;
}
.triangle {
background: blue;
color: black;
padding: 2em;
position: relative;
text-align: center;
width: 50em;
}
.triangle::before {
border-left: 27em solid transparent;
border-right: 27em solid transparent;
border-top: 13em solid coral;
content: "";
left: 0;
position: absolute;
right: 0;
top: 0;
z-index: 1;
}
.triangle::after {
background-image:
radial-gradient(
white 15%,
transparent 16%
),
radial-gradient(
yellow 15%,
transparent 16%
);
background-size: 1em 1em;
background-position: 0 0, .5em .5em;
bottom: -4em;
content: "";
left: 0;
position: absolute;
right: 0;
top: 0;
z-index: 2;
-webkit-clip-path: url(#cutClip); /* polygon(0 0, 100% 0, 100% 85%, 0 100%) */
clip-path: url(#cutClip);
}
<!-- content to be placed inside <body>…</body> -->
<div class="triangle"><h1>Le Quatuor Concertant</h1></div>
<svg width="0" height="0">
<clipPath id="cutClip" clipPathUnits="objectBoundingBox">
<polygon points="
0 0,
1 0,
1 .7,
.65 .7,
.5 1,
.35 .7
0 .7">
</polygon>
</clipPath>
</svg>
// alert('Hello world!');
{"view":"split","fontsize":"90","seethrough":"","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment