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

must not remove type="text" from <input type="text"> #798

Open
607011 opened this issue Feb 21, 2025 · 1 comment
Open

must not remove type="text" from <input type="text"> #798

607011 opened this issue Feb 21, 2025 · 1 comment

Comments

@607011
Copy link

607011 commented Feb 21, 2025

minify removes any type="text" from <input type="text">. If such an element is styled based on the CSS rule input[type="text"] the resulting minified code is semantically different from the source code.

I know, I can call minify with --html-keep-default-attrvals to retain that attribute, but it feels wrong, because other default attributes, which can safely be discarded, are affected as well.

@tdewolff
Copy link
Owner

Thanks for raising this. I understand this is a bit surprising, and the matter is unfortunate, but I believe that the correct CSS rule should be input:not([type]), input[type='text'], which most CSS frameworks seem to do in this case. That would style all text inputs, following the HTML specification more closely. Could that work for you?

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

No branches or pull requests

2 participants