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

New principle: Avoid introducing mode errors #532

Open
LeaVerou opened this issue Dec 4, 2024 · 0 comments
Open

New principle: Avoid introducing mode errors #532

LeaVerou opened this issue Dec 4, 2024 · 0 comments

Comments

@LeaVerou
Copy link
Member

LeaVerou commented Dec 4, 2024

Thinking about element overloading (#370) in our meeting today I realized something: the crux of it is avoiding mode errors: <input> and <link> are antipatterns because they have attributes that only apply when other attributes are set, or properties that make sense only when other properties have certain values. When this is not an issue, it's fine to reuse elements, e.g. reusing checkboxes for switches is fine.

So perhaps what we really need is a principle around mode errors, since that applies to other cases too, e.g. in CSS when we introduce properties that only have meaning when other properties are set it always ends up being a source of author pain (though sometimes unavoidable — but principles are rules of thumb, not laws).

@LeaVerou LeaVerou changed the title New principle: Avoid mode errors New principle: Avoid introducing mode errors Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant