skrollr
skrollr copied to clipboard
data-* attributes should be prefixed to avoid conflicts
Since this is a very isolated feature, it should be designed in a way where it can be used with many other features made by other developers. One way to do so is to ensure that global names are namespaced. So instead of data-0 or data-end you would write something like data-skrollr-0 or data-skrollr-end.
Good point, but so far nobody complaint. I'll keep this open as a feature request. A prefix option could be used which defaults to an empty string and could be set to skrollr or whatever someone wants to.
Note to self: skrollr-stylesheets would need to know about this prefix as well.
I would definitely love to see this feature as well :)
Perhaps a potential conflict might arise if someone wanted to use a numerical data attribute to set font weights. I recently found that I needed to alter font-weights via the HTML markup, rather than CSS, thus I was contemplating using data attributes, but instead opted for classes.
Anyway, just thought I'd ping the thread with another interested party. It's super useful already though!!
+1
+1!
I'd be happy to work up a PR too (for skrollr at least) if I knew it were going to be merged.