You can find a very detailed explanation about the how behind in my Taming Blend Modes: `difference` and `exclusion` article on @csstricks https://css-tricks.com/taming-blend-modes-difference-and-exclusion/
You can find a very detailed explanation about the how behind in my Taming Blend Modes: `difference` and `exclusion` article on @csstricks https://css-tricks.com/taming-blend-modes-difference-and-exclusion/
And here are cards with gradual left to right inversion: from no inversion at all on the left, to full inversion on the right. Again, minimal code, single div, no pseudos necessary, 2 #CSS declarations.
Live demos on @codepen
Here's another set of cards with varying patterns, all created with the exact same 4 blended CSS gradients, it's just the stops list `--c` that changes for each card.
So basically, it's again just one `background` + one `background-blend-mode` property.
Live demo on @codepen
https://codepen.io/thebabydino/pen/vYyNyER
And here's a cards demo with a cool, yet very simple trick: these left to right gradients are vibrant at the top, but then progressively get more and more desaturated going down, until fully grey.
Live on @codepen https://codepen.io/thebabydino/pen/xxzjJXL - only 2 CSS declarations necessary!
By the way, the code is heavily commented https://codepen.io/thebabydino/pen/MYWxeew
So you can see how it works without JS, without wrapping individual elements into spans, just letting it wrap naturally. And without covers that wouldn't allow for an image backdrop behind the text.
If we have an inline `span` inside a `p` & we give it a semi-transparent `background` + a `padding`, we get an alpha increase where backgrounds of adjacent lines overlap.
How would you solve this problem without text duplication, without stacking 2 identical `p` elements, one for background (opaque background + transparent text + opacity) and one for text (transparent background)?
Hi, mastodon I have a new article out!
A Deep Dive into the Inline Background Overlap Problem: https://frontendmasters.com/blog/overlapping-inline-backgrounds/
How do you get the below result (semi-transparent background on inline span) with large padding & no overlap?
Answer in article, but think a bit about it first.
Pure #CSS 1 div halftone-masked background card https://codepen.io/thebabydino/pen/GRNKqRv on @codepen.
Made this 4 years ago - can you guess how before checking the code?
Doesn't work in Firefox due to an old bug https://bugzilla.mozilla.org/show_bug.cgi?id=1481498 not even related to the halftone mask, but caused by the duo text on the right.
Really cool to see people linking my Frontend Masters article as a resource https://frontendmasters.com/blog/pure-css-halftone-effect-in-3-declarations/
By the way, this is my second article for Frontend Masters.
My first was a few months ago and it was about creating dynamic split effects (image, text, page) without any content duplication whatsoever https://frontendmasters.com/blog/split-effects-with-no-content-duplication/
I have a new article out: Pure CSS Halftone Effect in Only 3 Declarations
https://frontendmasters.com/blog/pure-css-halftone-effect-in-3-declarations/
This goes through the how behind the 3 declarations and then explores a lot of variations that help us produce cooler, more interesting
patterns.
A little @codepen demo I made some years back: #duotone a B&W image using pure #CSS #blending (and very little code in total) https://codepen.io/thebabydino/pen/MWbdbrm
With a comparison slider between the two blend modes that may be used for the effect and a picker for duotone palette base.
Created for my Taming Blend Modes #CSSTricks article https://css-tricks.com/taming-blend-modes-difference-and-exclusion/
Another request, mastodon
If you can test in Safari, can you let me know what the second (moving) line looks like for you?
https://codepen.io/thebabydino/pen/JjgdLQL?editors=1100
Cyan like expected/ Chrome/ Firefox? Lime like what I'm seeing with Epiphany?
Boosts appreciated if you cannot test. Thanks!
If you can test in actual Safari, could you let me know how this looks for you?
https://codepen.io/thebabydino/pen/YzoobYd
Like in the first screenshot or like in the second?
Thanks!
Saw some familiar demos among those trending on @codepen
blended layers
slice & offset
here is real magic
dizzy 3D
no matrix gooey effect
realistic grainy shadows
slice
split text effect
If you like split effects, I've collected a bunch of them with no content duplication in this post https://frontendmasters.com/blog/split-effects-with-no-content-duplication/
Note that the recordings were made on an old laptop and they suffer from compression. The live demos look better.
Enjoy!
We can also go the other way with the exact same minimal structure: from black and white photography to a duotoned image - see it on @codepen: https://codepen.io/thebabydino/pen/jOjLRyp
single element, no ::before or ::after
under 20 #CSS declarations
#JS only needed to update 1 CSS variable on drag
No text duplication, no JS, no images save for CSS gradients, no long lists of values for anything (like text-shadow).
Just plain text + CSS gradients + blending + the magic of #SVG filters for extrusion + texture
Offset & XOR frame - another one of my faves on @codepen: https://codepen.io/thebabydino/pen/RwoBREa
Made a few years back for my Taming Blend Modes article https://css-tricks.com/taming-blend-modes-difference-and-exclusion/