Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dollar sign in HTML attribute name

Tags:

html

polymer

I was looking at some Polymer code (link) and stumbled upon something new to me: a dollar sign $ in an html attribute name e.g.

<div class="item" wide-layout$="{{wide}}">

Also, a CSS selector is used:

.item[wide-layout] .title { ... }

How is the $ sign interpreted in the element attribute ?

Thanks for your time folks!

like image 457
jldupont Avatar asked Dec 05 '25 14:12

jldupont


1 Answers

Using $ on the element binds a property to an attribute. You can read more here.

wide in your scenario is probably a Boolean property on the element.

When wide = true, a wide-layout DOM attribute will be added to the element so it can be targeted via CSS.

like image 196
nicholaswmin Avatar answered Dec 07 '25 03:12

nicholaswmin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!