from Aaron Linn after a community meetup

Thank you Matt for the share yesterday. After you mentioned that naming the element provides a data attribute I went in to see how it showed up to see if we could use it as a CSS selector. Good news! We totally can. Here is a great page to help describe the different ways you can select a data attribute. Below is an example where I’ve used an exact value to set a background color.





This could be used almost like having a class that you specify on an element. It could potentially be used to set or pull out a background image at a specific breakpoint, and if you had a replacement image in the package that you could point to you could swap it out. 

  0     0

Similar Projects

Questions  ( 0 )