-
Notifications
You must be signed in to change notification settings - Fork 926
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
[Refactor HTML/CSS] Some selectors in _forms.scss are overly specific #891
Comments
form button[type=submit]
form input[type=submit]
and form input[name=password]
are overly specific
@webinista thanks for your feedback! We'd definitely like to review some of our specificity, so this is helpful. |
I think when we have any rules like this:
we should change to this:
|
Refs #1342 |
@msecret I just checked What you're referring to is in |
Yes their in inputs here: https://github.com/18F/web-design-standards/blob/staging/src/stylesheets/elements/_inputs.scss#L21. Something to try: why do we need the specific type rules if they all include |
I wouldn't close and reopen an issue, I'd just reuse this one. |
@msecret Is there any issue with: https://github.com/18F/web-design-standards/blob/staging/src/stylesheets/elements/_inputs.scss#L149
Do we want to change it to
? |
Description
form button[type=submit]
form input[type=submit]
andform input[name=password]
are more specific selectors than necessary. In order to override them, you have to use a selector that's at least as specific, or use the!important
keyword, e.g.form button[type=submit].my-specific-override-class
.Ask
De-nest these selectors, and use
[type=submit]
and[name=password]
instead. They are less specific, which means a developer can override specific declarations with a class name.To Do
web-design-standards/assets/_scss/components/_forms.scss
and move the rulesets forbutton[type=submit]
,input[type=submit]
, andinput[name=password]
out of theform
block.[type=submit]
and[name=password]
The text was updated successfully, but these errors were encountered: