google / google/material-design-lite
Namespace data attributes
- Dominant language
- HTML
- Stars
- 32.2k
- Forks
- 4.9k
- PR merge metrics
- No merged PRs in 30d
Description
## Problem data attribute names are not isolated
The Icon Toggle component, for example, currently uses `data-toggle-on` and `data-toggle-off` to store the attributes to be changed around. We should make these `data-mdl-toggle-on` and `data-mdl-toggle-off` to avoid accidental collisions with user-land code. For example, a developer could be integrating icon toggle's into an existing application where they do something like `$('[data-toggle-on]').forEach(item => {});` within their existing code which could then collide with our component and make things more difficult.
## Solution
use `mdl-` prefix on data attributes used internally.
Contributor guide
Assessment
This issue has not been assessed yet.