Video yükleniyor...

Video Yüklenemedi

Ana Sayfaya Dön

highlighting with CSS :has() 💡 td:has(~ td:hover), /* previous sibling cells */ table:has(td:nth-of-type(3):hover) /* column cells */ tr:not(:first-of-type):has(~ tr:hover) td:nth-of-type(3) { background: var(--highlighted); }

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

11 Yorum

Dan DiGangi profil fotoğrafı
Dan DiGangi1 yıl önce

sometimes you do wild stuff and im like, wow. other times you do simple concepts and im still like, wow. lol

jhey ▲🐻🎈 profil fotoğrafı
jhey ▲🐻🎈1 yıl önce

'ppreciate that 🤙 need to tap into my ideas backlog – feels like I haven't been making anything cool lately 🫣

UserInterface profil fotoğrafı
UserInterface2 yıl önce

What is Web3? The Next Evolution of the Internet #tech #news

Tally Schmeits profil fotoğrafı
Tally Schmeits1 yıl önce

This is so nice and usefull at the same time 🙏🏻🔥

Adam Knight profil fotoğrafı
Adam Knight1 yıl önce

This is brilliant. I'm literally working on an app for a data tabulation engine and need a simple highlighting solution. This I think is perfect!

Faisal profil fotoğrafı
Faisal1 yıl önce

You’re amazing with css!! How did you become a master? Any short roadmap or resource that you can share?

Mike profil fotoğrafı
Mike1 yıl önce

X needs code snippets badly. Blows my mind they aren’t here yet. @x what’s up?

Tom Notes profil fotoğrafı
Tom Notes1 yıl önce

You're just too excellent at this. 🎉🎉🎉🎉

Patrick ✦ profil fotoğrafı
Patrick ✦1 yıl önce

you're like the Aleister Crowly of obscure CSS jesus man

Arthur 🍎 profil fotoğrafı
Arthur 🍎1 yıl önce

Saved 💡

wozu profil fotoğrafı
wozu1 yıl önce

Looks like css will become programming language soon lol

Benzer Videolar

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,300 görüntüleme • 2 yıl önce

2 Pathan friends with 3 type of pushto 😜🤗
1:08

Sensitive content

2 Pathan friends with 3 type of pushto 😜🤗

Sadaf Khan

30,511 görüntüleme • 3 ay önce

CSS Trick 🤙 You can create these tab bar controls by using :has() to count the number of tabs ⭐️ .tabs:has(input:nth-of-type(3)){--count: 3;} .tabs:has(:checked:nth-of-type(3)){--active: 200%;} .tabs::after{ translate:var(--active) 0;} Let's break it down in this ! 📼 Couple of CSS :has() tricks here combined with custom properties 😎 First things first, lay out the tabs using display: grid. This gives you a way to create equal-width tabs 🙏 .tabs { display: grid; grid-auto-flow: column; } Then you use :has() to count the number of tabs and store that in a custom property 🤓 .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 🫶 Using the tab count, you can size the tab indicator. For the tab indicator, use the tabs pseudoelement: .tabs::after { content: ""; position: absolute; height: 100%; width: calc(100% / var(--count)); } See how you can use --count to determine its size 📏 Next, use :has() to determine which tab is active or :checked with 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; } Or you could set active to the translation: .tabs:has(:checked:nth-of-type(2)) { --active: 100%; } Setting the custom property allows you to use the index elsewhere if you need it 🤙 The final piece 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 ʕ•ᴥ•ʔ

70,670 görüntüleme • 2 yıl önce