
frontend fighter @hellowearemito, ultimate athlete, hustler, life long learner, bookworm,craft biere enthusiast
Joined June 2009
- Tweets2.8K
- Following1.5K
- Followers198
- Likes10.7K
twevente_wolf retweeted
Do you know we can easily add an offset to text underlines to make them look better?
twevente_wolf retweeted
The new if() selector in CSS lets you write conditional styles inline.
You can also switch based on custom properties:
twevente_wolf retweeted
Here's a fun TS tip:
Use a template literal string to make sure your Authorization headers are correctly formatted.
twevente_wolf retweeted
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/
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…
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!
twevente_wolf retweeted
🔗 Alternatives to Using Pure Black (#000000) for Text and Backgrounds
uxplanet.org/alternatives-to…
#a11y #design
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…
Today, I became an AWS Certified Cloud Practitioner. @awscloud. credly.com/badges/1c8933ab-4…
2
53
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
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 🥳
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! 👇













