𝙻𝚘𝚔𝚎𝚜𝚑 𝚁𝚊𝚓𝚎𝚗𝚍𝚛𝚊𝚗 retweeted
2025 CSS Reset
2024 CSS Reset
43
245
11
3,051
543,915
𝙻𝚘𝚔𝚎𝚜𝚑 𝚁𝚊𝚓𝚎𝚗𝚍𝚛𝚊𝚗 retweeted
Replying to @nixcraft
If you're gonna run code from the internet you don't understand, maybe start with: docker run -it --rm alpine:latest sh and then run it ;-)
31
126
5
3,154
85,843
𝙻𝚘𝚔𝚎𝚜𝚑 𝚁𝚊𝚓𝚎𝚗𝚍𝚛𝚊𝚗 retweeted
I wanted to share the following 10 Tailwind techniques. These will come in handy next week. For those who don’t use Tailwind, here be dragons! 1/10 - Let’s start simple. Set a CSS variable (width) based on state and use an arbitrary className.
93
581
44
5,468
348,982
𝙻𝚘𝚔𝚎𝚜𝚑 𝚁𝚊𝚓𝚎𝚗𝚍𝚛𝚊𝚗 retweeted
Things I should have put in my .gitconfig years ago
112
637
37
9,585
916,589
𝙻𝚘𝚔𝚎𝚜𝚑 𝚁𝚊𝚓𝚎𝚗𝚍𝚛𝚊𝚗 retweeted
We didn't get into @ycombinator summer batch -- but we don't need them away 🥲 But here's our demo video -- enjoy ❤️ #investment #startup #storyboard #ux #buildinginpublic
66
35
10
531
57,837
𝙻𝚘𝚔𝚎𝚜𝚑 𝚁𝚊𝚓𝚎𝚗𝚍𝚛𝚊𝚗 retweeted
the little details™ Use trigonometric functions in CSS to create a smooth staggered transition delay 🎬 .character { transition-delay: calc(sin((var(--index) / 12) * 45deg) * 0.475s); }
Still can't believe this effect can be achieved by a single line of code. Mind blowing.
55
487
35
5,373
540,169
𝙻𝚘𝚔𝚎𝚜𝚑 𝚁𝚊𝚓𝚎𝚗𝚍𝚛𝚊𝚗 retweeted
CSS Tip! 🍬 You can create a CSS-only sticky CTA using position: sticky or scroll-driven animations 🤙 .cta { position: sticky; margin-top: 110vh; bottom: 2rem; /* 👈 Stick! */ } This is one way 👀 This first way relies on you setting a layout on the body and putting the CTA in a zero-space part of the layout body { display: grid; grid-template-columns: auto 0; } The children of the body are an element with your content and then the CTA. You could also use display:flex too. .content { flex: 1 0 100%; } .cta { place-self: end; } As you scroll the body, the CTA comes into view and sticks in position 🙌 That's one way. If you want to take it further and do something like flip between showing or not, maybe scale it up, or add some special easing, etc. an animation is another way 📜 First, change the styles for your CTA. Note the translate property that's powered by a custom property .cta { position: fixed; bottom: 2rem; right: 2rem; translate: 0 calc(20vh - (var(--show) * 20vh)); transition: translate 0.875s var(--elastic); } Next you need a custom property that you're going to animate @​property --show { inherits: true; initial-value: 0; syntax: '<number>'; } Lastly, you animate this value on the body. As the property value changes, the value will trickle down to the CTA @​supports (animation-timeline: scroll()) { body { animation: show-cta both steps(1); animation-timeline: scroll(root); animation-range: 0 10vh; } @​keyframes show-cta { to { --show: 1; } } } Using @​supports you can use this as a progressive enhancement. If scroll-driven animations are supported, use them. Otherwise fallback to using position: sticky 🤙 That's it! As always, any questions or requests, hit me up! 🙏 @CodePen link below! 👇
Summoning the CSS wizard @jh3yy 🧙 How would you do that sticky button CTA without JavaScript 👀
13
77
4
817
133,210
𝙻𝚘𝚔𝚎𝚜𝚑 𝚁𝚊𝚓𝚎𝚗𝚍𝚛𝚊𝚗 retweeted
🎉 All major browsers now support the new Array.prototype.with method 🥳 developer.mozilla.org/en-US/… Ideal for immutable updates. Here is an example with Angular signals:
4
29
141
8,622
𝙻𝚘𝚔𝚎𝚜𝚑 𝚁𝚊𝚓𝚎𝚗𝚍𝚛𝚊𝚗 retweeted
Introducing the Bun Shell Cross-platform shell language & interpreter for shell scripting with JavaScript
152
409
246
3,650
994,027
𝙻𝚘𝚔𝚎𝚜𝚑 𝚁𝚊𝚓𝚎𝚗𝚍𝚛𝚊𝚗 retweeted
What if the scrollbar went around the corner? 👀 CSS could do that ✨
A scroll indicator that wraps around a rounded corner by @RoberaGeleta
109
527
64
6,235
847,386
𝙻𝚘𝚔𝚎𝚜𝚑 𝚁𝚊𝚓𝚎𝚗𝚍𝚛𝚊𝚗 retweeted
Cool demo of what PWAs can do today: whatpwacando.today This site can be installed as a PWA and you can try all these features on your phone.
51
158
17
1,046
152,340
𝙻𝚘𝚔𝚎𝚜𝚑 𝚁𝚊𝚓𝚎𝚗𝚍𝚛𝚊𝚗 retweeted
We all know the HTML <input> tag but I was today years old when I learned about <output>
19
31
6
534
80,545
𝙻𝚘𝚔𝚎𝚜𝚑 𝚁𝚊𝚓𝚎𝚗𝚍𝚛𝚊𝚗 retweeted
How much of this math do you know? A clever animation vs math by Alan Becker [full video: buff.ly/44cL72j] xitter.cf/Levandov_2/status/1708…
151
4,000
330
18,497
2,807,581
𝙻𝚘𝚔𝚎𝚜𝚑 𝚁𝚊𝚓𝚎𝚗𝚍𝚛𝚊𝚗 retweeted
Coding be like...
4
7
44
3,061
𝙻𝚘𝚔𝚎𝚜𝚑 𝚁𝚊𝚓𝚎𝚗𝚍𝚛𝚊𝚗 retweeted
Another one, very subtle this time: { 0% { mask: linear-gradient(90deg, #000 25%, #000000e6 50%, #00000000) 150% 0 / 400% no-repeat; opacity: .2; } 100% { mask: linear-gradient(90deg, #000 25%, #000000e6 50%, #00000000) 0 / 400% no-repeat; opacity: 1; } }
28
217
6
2,599
𝙻𝚘𝚔𝚎𝚜𝚑 𝚁𝚊𝚓𝚎𝚗𝚍𝚛𝚊𝚗 retweeted
Your icons should be SVG sprites instead of JSX - make a component like <Icon name="trash" /> - get autocomplete for icon names - auto build the spritesheet when new svgs are added jacobparis.com/content/svg-i…
18
55
2
509
89,296
𝙻𝚘𝚔𝚎𝚜𝚑 𝚁𝚊𝚓𝚎𝚗𝚍𝚛𝚊𝚗 retweeted
🎨 CSS tip(3): `height: 100vh` is a common way to make your app fit the whole window. It won't do a good job on mobile though 😬 `height: 100dvh` works way better! 📱 See the difference on your phone: dvh.stackblitz.io 💻 Play with the demo: stackblitz.com/edit/dvh?file…
37
435
22
2,362
277,011
𝙻𝚘𝚔𝚎𝚜𝚑 𝚁𝚊𝚓𝚎𝚗𝚍𝚛𝚊𝚗 retweeted
I was unaware of `text-wrap: pretty;` I knew about the (new/cool) `text-wrap: balance;` — but sometimes that's a bit... too much. I feel like it's nice on headers but not smaller type. Here's what I mean.
19
151
20
1,396
393,969
𝙻𝚘𝚔𝚎𝚜𝚑 𝚁𝚊𝚓𝚎𝚗𝚍𝚛𝚊𝚗 retweeted
pkg-size.dev is beautiful 😍 It also installs and bundles packages *in your browser tab* which makes the UX far more capable & interactive (And ofc, built with WebContainers!)
📦🔍 Excited to introduce pkg-size.dev A new tool for JavaScript devs to examine npm packages and help determine the installation size and bundle size Let’s dive into what it can do...
4
8
38
10,379