Video yükleniyor...

Video Yüklenemedi

Ana Sayfaya Dön

small details that matter 🧑‍🍳 use CSS pseudoelements to bridge the :hover gap w/ :has() + inset a:has(+ .dots) a::after, .dots + a::after { position: absolute; content: ''; } a:has(+ .dots) a::after { inset: 0 -50% 0 100%; } .dots + a::after { inset: 0 100% 0 -50%; }

117,396 görüntüleme • 1 yıl önce •via X (Twitter)

20 Yorum

misho profil fotoğrafı
misho1 yıl önce

i need jhey mcp server, can’t keep bookmarking these

jhey ʕ•ᴥ•ʔ profil fotoğrafı
jhey ʕ•ᴥ•ʔ1 yıl önce

at some point, it’s gotta happen 😅

Rafi Wirana profil fotoğrafı
Rafi Wirana1 yıl önce

more like this please

jhey ʕ•ᴥ•ʔ profil fotoğrafı
jhey ʕ•ᴥ•ʔ1 yıl önce

@arayyye 🙏🙏🙏

Rafi Wirana profil fotoğrafı
Rafi Wirana1 yıl önce

you are special man

jhey ʕ•ᴥ•ʔ profil fotoğrafı
jhey ʕ•ᴥ•ʔ1 yıl önce

@arayyye oh wow 🙇‍♂️

Othman B. profil fotoğrafı
Othman B.1 yıl önce

Thanks for the tips, it will be so if you post code intended like with 😁

jhey ʕ•ᴥ•ʔ profil fotoğrafı
jhey ʕ•ᴥ•ʔ1 yıl önce

my goal is jus' to release the course/reference/platform site and link to the snippets there 🤞

noor profil fotoğrafı
noor1 yıl önce

Every single post, I learn something new

jhey ʕ•ᴥ•ʔ profil fotoğrafı
jhey ʕ•ᴥ•ʔ1 yıl önce

@divandcode legend 🙏

Aatif Sohel profil fotoğrafı
Aatif Sohel1 yıl önce

Awesome share 👌🏻

jhey ʕ•ᴥ•ʔ profil fotoğrafı
jhey ʕ•ᴥ•ʔ1 yıl önce

🙏

matt profil fotoğrafı
matt1 yıl önce

😲

jhey ʕ•ᴥ•ʔ profil fotoğrafı
jhey ʕ•ᴥ•ʔ1 yıl önce

initially when i looked at this, i was like "nah", and did a little scripted solution then i sat on it for a day and implemented in my head whilst drinking my coffee 😅

matt profil fotoğrafı
matt1 yıl önce

simple!

Daily Nomad profil fotoğrafı
Daily Nomad1 yıl önce

The only reason i want to learn code is to be able to do stuff like this

Jyri profil fotoğrafı
Jyri1 yıl önce

Ok bookmarked this banger

Pochi profil fotoğrafı
Pochi1 yıl önce

This is such a clever use of `:has()` It's amazing to see how modern CSS features are solving old problems in such elegant ways. The days of needing JavaScript for complex hover effects are numbered.

Zafar profil fotoğrafı
Zafar1 yıl önce

Practical UX in web at its best. Nice tip.

Bole Chen profil fotoğrafı
Bole Chen1 yıl önce

I can’t reproduce this effect on my local Chrome. Could you share a CodePen link? Thanks for your sharing.

Benzer Videolar

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 🤙 Click me! 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.IO link below 👇

jhey ʕ•ᴥ•ʔ

283,498 görüntüleme • 2 yıl önce

CSS Tip! 💪 You can create these tab controls with CSS :has() + radio buttons ✨ .tabs:has(input:nth-of-type(3)) { --count: 3; } .tabs:has(:checked:nth-of-type(3)) { --active: 2; } .tabs::after { translate: calc(var(--active, 0) * 100%) 0; width: calc(100% / var(--count)); } Two CSS :has() tricks here combined with a rendering trick 🤙 The tab control is a container using display: grid. You can use :has() to count the number of tabs in the container: .tabs:has(input:nth-of-type(3)) { --count: 3; } .tabs:has(input:nth-of-type(4)) { --count: 4; } Using the cascade, the last valid :has() gives you the number of tabs 🫶 Once you know the number of tabs, you know how to size the indicator: .tabs::after { content: ""; position: absolute; height: 100%; width: calc(100% / var(--count)); } It's a pseudoelement that uses --count to determine its size 📏 The next :has() trick is determining which tab is active or :checked as it's an input [type=radio] .tabs:has(:checked:nth-of-type(2)) { --active: 1; } .tabs:has(:checked:nth-of-type(3)) { --active: 2; } You can use a zero-indexed translation here. If the second input is :checked, set --active: 1, then translate the pseudoelement on the tabs to that position 👉 .tabs::after { translate: calc(var(--active, 0) * 100%) 0; } The last rendering trick is using mix-blend-mode 👀 The tabs have a black background-color, the pseudoelement is white, and the label text is white. When you use mix-blend-mode: difference on the pseudoelement it will give this effect that the text transitions from white to black sliding across 😎 .tabs::after { color: hsl(0 0% 100%); mix-blend-mode: difference; } You can totally mix up the colors here though and go with a different effect. The mechanics of how you can use CSS :has() is the main point here 🙏 As always, any questions, suggestions, etc. let me know CodePen.IO link below! 👇 (There's even a Tailwind CSS play for this one too 👀)

jhey ʕ•ᴥ•ʔ

437,855 görüntüleme • 2 yıl önce