Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat request: Should ignore duplicates in class names list #138

Closed
qfox opened this issue Mar 15, 2016 · 4 comments · Fixed by #140
Closed

Feat request: Should ignore duplicates in class names list #138

qfox opened this issue Mar 15, 2016 · 4 comments · Fixed by #140
Labels

Comments

@qfox
Copy link
Member

qfox commented Mar 15, 2016

<div class="popup welcome popup popup welcome"></div>
should be equivalent to
<div class="welcome popup"></div>

@eGavr
Copy link
Member

eGavr commented Mar 16, 2016

Are you sure that it is necessary to do do ?

Could you give some links to spec ?

@qfox
Copy link
Member Author

qfox commented Mar 16, 2016

ex1:

var elem = document.createElement('div');
elem.className = 'popup popup open popup';
console.log(elem.classList); // ["popup", "popup", "open", "popup"]

ex2:

var elem = document.createElement('div');
elem.classList.add('popup')
elem.classList.add('popup')
elem.classList.add('open')
elem.classList.add('popup')
console.log(elem.classList); // ["popup", "open"]

https://www.w3.org/TR/html401/struct/global.html#h-7.5.2

@eGavr
Copy link
Member

eGavr commented Mar 16, 2016

It should be an option or used by default?

@qfox
Copy link
Member Author

qfox commented Mar 16, 2016

I don't see why it should be hidden under option. It's like resorting class names inside class attribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants