codyhouse / codyhouse-framework

A lightweight front-end framework for building accessible, bespoke interfaces.
https://codyhouse.co/
MIT License
1.16k stars 173 forks source link

Use data attributes instead of js-* classes #125

Open erolabzait opened 2 years ago

erolabzait commented 2 years ago

Hello,

Thanks for your great work, i really appreciate the Tailwind integration.

Can you consider in the future using data attributes instead of **js-*** classes, with Tailwind it's kind of hard to spot them.

js-slideshow -> data-cd-slideshow / data-slideshow / data-*-slideshow
js-slideshow__item -> data-cd-slideshow-item / data-slideshow-item 

Or a custom cumponent approach without shadow dom. https://github.com/Shopify/dawn/blob/main/snippets/cart-notification.liquid https://github.com/Shopify/dawn/blob/main/assets/cart-notification.js

<cd-slideshow>
  <div data-slideshow-item></div>
  <div data-slideshow-item></div>
  <div data-slideshow-item></div>
</cd-slideshow>
claudia-romano commented 2 years ago

Hi there, I see your point. Yes, for the Tailwind version we can look into using data attributes rather than js classes. It will take some time to update all components though, but this is something we'll look into. Thanks for the suggestion!