Currently, Drupal's forms only contain an ID attribute. This is a problem because:
- This is the only "styling hook" we have from a CSS standpoint and styling against ID's is generally not a best practice.
- ID's have a high CSS specificity. There are cases where Drupal core provides styles for form elements based on the form they are in. Because ID's are used in the CSS selectors, overriding the behavior in the theme layer requires (a) more specific selectors in order to win specificity wars and (b) unnecessary special-casing.
- ID's that are applied to forms are auto-generated and cannot safely be relied upon for theming purposes. If two of the same forms appear on the same page, you're left having to style both #form-1 and #form-2, which is far from efficient.
I'd like to see us add the name of the form as a class to use for styling purposes. I'm not asking to remove the ID's because they are still useful for other jobs, like quick DOM traversal and AJAX operations.