Created
May 30, 2018 12:46
-
-
Save LeaVerou/666bf89778f20f77a5f4d4f5e0e816d2 to your computer and use it in GitHub Desktop.
Cutout text with any color — sadly with text repetition
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
/** | |
* Cutout text with any color — sadly with text repetition | |
*/ | |
body { margin: 0 } | |
main { | |
background: url('https://leaverou.github.io/talks/even-more-css-secrets/img/whisper.jpg') center / cover no-repeat gray; | |
min-height: 100vh; | |
} | |
div { | |
mix-blend-mode: screen; | |
font: bold 800%/1 Helvetica Neue, sans-serif; | |
background: white; | |
color: black; | |
position: absolute; | |
padding: .3em; | |
} | |
div + div { | |
background: #f06; | |
color: white; | |
mix-blend-mode: multiply; | |
} |
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
<main> | |
<div>Cutout text</div> | |
<div>Cutout text</div> | |
</main> |
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
// alert('Hello world!'); |
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
{"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"","page":"css"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment