My dear front-end developers (and anyone who’s interested in the future of interfaces):
I have crawled through depths of hell to bring you, for the foreseeable years, one of the more important foundational pieces of UI engineering (if not in implementation then certainly at least in concept):
Fast, accurate and comprehensive userland text measurement algorithm in pure TypeScript, usable for laying out entire web pages without CSS, bypassing DOM measurements and reflow
I have been summoned ✨
tried out Claude + Pencil, can’t believe how fast this was designed/built 🤩
still need to tweak some stuff, but off the bat it looks amazing!
https://t.co/NN2DQ3vk1S
you can instantly 10x your vibecoded frontends by just learning what different ui components are called
ofc opus is creating generic slop, the only words you know are menu and button.
CSS Tip! ✨
It's 2024 and you have a new way to make animated borders 🚀
.glow::after {
offset-path: rect(0 100% 100% 0 round var(--radius));
animation: loop;
}
@keyframes loop { to { offset-distance: 100%; }}
Using the offset-* properties you can animate elements along the perimeter of others 😍
The rect() value gained support in Safari 17.2 🙌
To start, you create an element and put it inside your main element. For example, you put a span inside the button 🤙
<button>
<span data-glow />
Click me!
</button>
Make the element fill its parent with absolute positioning and inset
[data-glow] {
position: absolute;
inset: 0;
}
Now the good part, you use a pseudoelement on that element and define an offset-path
[data-glow]::after {
content: "";
offset-path: rect(0 auto auto 0 round var(--radius));
animation: loop 2.6s infinite linear;
}
With the rect value, you are saying the path fills the parent container:
top: 0
right: auto || 100%
bottom: auto || 100%
left: 0
Then you can use round to make sure the path uses the same radius as whatever the parent has
The @keyframes animation merely animates the offset-distance of that pseudoelement to 100%
@keyframes loop { to { offset-distance: 100%; }}
You can see this more clearly in the video 🫶
The offset-* properties also include an offset-anchor property. This allows you to dictate which point of the element follows the path. For example:
anchor-offset: 100% 50%;
This means that the "right, center" of the element will follow the perimeter of the parent element 🤙
Lastly, the visuals 🎨 For color, you can use a gradient such as a linear gradient to fill the pseudo-element.
[data-glow]::after {
background:
radial-gradient(
circle at right,
hsl(320 90% 100%),
transparent 50%
);
}
Then clip away everything so you only have the border and can still have translucent backgrounds, etc. Use a mask with mask-composite ✨ A little transparent border trick:
[data-glow] {
border: 2px solid transparent;
mask:
linear-gradient(transparent, transparent),
linear-gradient(white, white);
mask-clip: padding-box, border-box;
mask-composite: intersect;
}
Bit of a long one. Hope you find it useful 🙏
@CodePen link below 👇
🔥 As of today, CSS :has() is now supported in every browser!
This is a next-level selector that opens up a ton of new possibilities. Here are 10 hot tips for using CSS :has()
Details of each below
Here's a fun concept - Filtering tags made with only pure #CSS (with no #javascript at all) using the :has selector 👍
Here's the @CodePen:
https://t.co/3AWJpfwG84
A recap of the 20 top Web UI things we talked about at Google I/O yesterday ⏪⏪⏪
If you're a front-end dev who builds and styles interfaces, be sure to check it out and catch up on all the things! 🌈💖👇
✍🏼 Written by @argyleink@bramus & me! 🥳
https://t.co/kVTTr3VcO5
especially CSS Nesting, it would not only save the hassle of installing Sass package, but also helps minimize repetition and group related elements together #GoogleIO📷 ✨
https://t.co/eOWNnUsRCW
What's new in Web UI? 👀
A whole lot, actually 😛
Learn about 20 of the most useful new & upcoming features in CSS & HTML! #GoogleIO
- logical styles
- color features
- typography updates
- component primitives
- architectural controls
- interactions++
https://t.co/kJ705nZ99m
Have you tried out the View Transitions API? ✨
Been playing have a play with it this evening 👀
A bit of JavaScript Web Animations API usage for those rainbow lines but sets me up for another demo idea! 💡
Repo && deets 👇