twevente_wolf (@twevente_wolf) profile picture

frontend fighter @hellowearemito, ultimate athlete, hustler, life long learner, bookworm,craft biere enthusiast

Joined June 2009
Photo by twevente_wolf (@twevente_wolf)Photo by twevente_wolf (@twevente_wolf)Photo by twevente_wolf (@twevente_wolf)Photo by twevente_wolf (@twevente_wolf)Photo by twevente_wolf (@twevente_wolf)Photo by twevente_wolf (@twevente_wolf)Photo by twevente_wolf (@twevente_wolf)Photo by twevente_wolf (@twevente_wolf)
Do you know we can easily add an offset to text underlines to make them look better?
1
1
5
342
The new if() selector in CSS lets you write conditional styles inline. You can also switch based on custom properties:
63
138
46
1,595
146,682
Here's a fun TS tip: Use a template literal string to make sure your Authorization headers are correctly formatted.
32
223
24
3,460
188,471
Hello Monday Procrastination! Let's brings back some good memories with some old school DOS games, brought back in the browser, in a modern way! This site features 639 original DOS games. It should keep you busy a couple of hours. Here you go: playdosgames.com/
1
2
514
twevente_wolf retweeted
learn about #CSS `interpolate-size: allow-keywords;` from @bramus on the Chrome Blog Animate to height or width `auto`! developer.chrome.com/docs/cs…
7
40
2
386
28,258
twevente_wolf retweeted
Using the CSS Custom Highlight API to create dynamic typing animations ✨ No need to update or change the DOM content 👀 The content is always there, you're jus' highlighting it to create the effect!
15
98
2
1,247
87,010
🔗 Alternatives to Using Pure Black (#000000) for Text and Backgrounds uxplanet.org/alternatives-to… #a11y #design
78
944
76
9,550
754,692
wolfmother! here we come!
18
twevente_wolf retweeted
neat #CSS trick‽ transition `border-image-outset` I'd normally reach for `box-shadow` for expandos like this, but then you can't use gradients or control direction much with this, I can expand to any size or side and use gradients, yeeee 🤓 src ⤷ codepen.io/argyleink/pen/abx…
10
41
2
391
33,051
NO CHEATING. Type your name in the GIF bar and see what comes up. Here's mine
2
2,673
twevente_wolf retweeted
CSS Tip! 🤙 You can create this text hover effect with :has() and custom properties .details:has(a:hover) *:not(:hover) { opacity: 0.1; } a:hover { --active: 1; } .char { translate: calc(var(--active) * var(--x) * 1%) ... ; } The trick here is using :has() to create an exclusionary effect where you select all children except the one that is being hovered or focussed ✅ .details:has(a:is(:hover, :focus-visible)) *:not(:hover, :focus-visible) { --opacity: 0.1; } .details :is(span, a) { opacity: var(--opacity, 1); transition: opacity 0.2s; } For the random translations, you can use a little JavaScript to generate some random inline custom property values after splitting up the words into characters 😎 For example, a character could look like this 👇 <span class="char" data-char="A" style="--r: -6; --y: -1; --x: -22;">A</span> And then when you hover or focus that link, you activate the CSS transforms! 🚀 a:is(:hover, :focus-visible) { --active: 1; } .char { transition: transform 0.25s var(--elastic); display: inline-block; transform: rotate(calc((var(--active) * var(--r)) * 1deg)) translate( calc((var(--active) * var(--x)) * 1%), calc((var(--active) * var(--y)) * 1%) ); } You can get as wild as you want with those transforms. Make them span really far as little as you like! It's important that when you duplicate the characters, you don't replace them. Otherwise, it could be picked up terribly by the accessibility tree 😬 A nice way around this is to duplicate and hide the visual characters from screenreaders and make the non-broken up words screenreader only 🙌 <span aria-hidden="true"> <span class="char" style="--r: -1; --y: -3; --x: -17;">T</span> <span class="char" style="--r: 2; --y: -27; --x: -7;">w</span> <!-- Other characters --> </span> <span class="sr-only">Tweet</span> As always, any questions or suggestions, hit me up! 💯 @CodePen link below! 👇
This post is from an account that no longer exists. Learn more
12
112
2
1,000
106,833
twevente_wolf retweeted
Vertical centering for `display: block` is coming to a browser near you! `align-content: center` is now supported in Chrome 123, Safari 17.4 beta, and in development in Firefox 🥳
7
53
18
414
49,143
twevente_wolf retweeted
CSS Tip! 📜 You can create scroll indicators with scroll-driven animations 📍 Reveal a shadow, mask the content, etc. .indicator--top { animation: reveal; animation-timeline: scroll(nearest); animation-range: 0 2rem; } @​keyframes reveal { 0% { scale: 1 0; }} The trick here is to hook into the scroll position of the nearest scroll container with .indicator { animation-timeline: scroll(nearest); } Your reveal animation is going to scale the indicator up from 0 on the y-axis @​keyframes reveal { 0% { scale: 1 0; }} The timeline is however much you want to scroll by before revealing the indicator. In this example, you're saying to reveal the indicator once the scroller has been scrolled by 2rem .indicator--top { animation-range: 0 2rem; } How do you make this work for the opposite indicator? Use animation direction and a range based on the end of the scroller .indicator--bottom { animation-range: calc(100% - var(--scroll-buffer)) 100%; animation-direction: reverse; } You can use this same concept for the different styles to reveal different indicators. The only one that's different is the mask. The mask one animates the mask size across three mask layers and uses a mask composite to exclude the pieces that don't need to be shown 🤙 As always, any questions or requests, hit me up! 🙏 @CodePen link below! 👇
8
110
5
1,115
99,451
twevente_wolf retweeted
riffin' on CSS gradient scrollbar effects ✨
6
46
3
692
49,645
beerGasm /noun/ - the little rush you feel after the first sip of a good beer
1
47
twevente_wolf retweeted
auto-growing <textarea> without JavaScript! CSS is getting field-sizing: content; to size inputs by their contents. Dropped in Chrome Canary today, demo here:
31
246
28
1,921
203,661