The attr CSS Function Is Incredible

preview_player
Показать описание


🌎 Find Me Here:

#Shorts
Рекомендации по теме
Комментарии
Автор

So glad I saw someone writing code do the same =""3 shit I do. That auto " always gets you.

cjmattrocks
Автор

I'm a web developer for the past 5 years now and I didn't know that even existed. Thanks!

idan
Автор

Dude, if only CSS allowed for the attr() elsewhere than in the content property, it'd be an absolute game changer

totoshampoin
Автор

Oh man ! I really fell in love with these short videos!
Thank you for these valuable tips..

mohammedjabir
Автор

You can also use css variables:
HTML:
<button style=“—count: 5;”>Button</button>
CSS:
content: —count;
JS: buttonEl.style.setProperty(“—count”, currCount)

dungphan
Автор

I was just using this for tool tips. Add the tool tip as a data attribute and display it on hover.

(you can also remove pointer-events from the pseudo element to make it feel more natural)

AJman
Автор

Oh wow! That is actually really easy and simplifies code a lot! Before REALLY learning CSS, I would JS the hell out of things, but CSS is way more powerful than we think.

getellied
Автор

Where have you been all my life? I've been looking for this everywhere.

zerubabelyonas
Автор

Thanks Kyle. You are damn efficient in putting out useful content.

andrebotha
Автор

I've used in a project before and helped me a lot and got surprised how powerful it was

hassanabdellah
Автор

Теперь главное не забыть))

Now the main thing is not to forget))

MrVertu
Автор

So grateful for these shorts. Learnt a lot in 1 min.

aoa-nd
Автор

This is such a helpful tip. I had the exact same problem and solved it in a much more convoluted way and this is so much simpler.

dylanthony
Автор

i opened my mouth when i saw this!! what a great function...i didn't know it, thanks a lot

joodjindy
Автор

Wow, I did not know that, absolutely amazing! I had so many situations where this would have been useful

Mane
Автор

How is it that this is the first time I see someone mention this function, it's so useful yet I hear so little about it!

davidkonevky
Автор

This shit changed my life on a project a few years ago. Really good share sir 👍

rBroneak
Автор

Bro your level of simple explanation 🔥🔥🔥🔥

developermohsin
Автор

This needs a lot more recognition. You can also use inline css variables, too.

Issvor
Автор

i had no idea you could do this. this is insanely useful!

erice.