-
Notifications
You must be signed in to change notification settings - Fork 2
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
Form css id or css class may reflect form's class #12
Comments
Well, if I am understanding you correctly, we do not always need a class, but it would be nice to add one based upon the function (or, to make things simpler, the layout or appearance) of a form. So default forms get the default form styling, and a form such as - for example - a filter form (which may appear in the browser horizontally) gets a class of .horizontal or something similar. It's not great to choose non-semantic names like this, but if we choose semantic names, we end up with a lot of css selectors. Why? To go back to your question, we could achieve this without form classes and based upon context (put the form in a box with the class .horizontal-form') so if you want to do it this way instead, that's ok. Downside to this is that we add another container, when there is a perfectly good container already (form). |
No I meant more something like:
Meaning there would be distinct CSS class for any PHP form class. |
So, in other words, an id, right? :) An id is nice (as there may be times when we want to either style a specific form or easily access a specific form in JS), but being able to add a class for a type of form is really useful (see previous comment) |
Muhahaha! You fell into the "id trap" :) I thought to do so first too, but then.... you can't assure that there will be only one form for each class ;)
resulting in duplicate ID ;) |
NOOOOOOooooooooooooooooo.................. :) Good point, so it has to be a class, then. Does that mean we can still add another class, where required? To go back to your original question, we should still probably keep the form naming class, just in case |
Makes sense to use ID, after all... because it's really uncommon to use tho instances of same form on one page. And you can unset the ID if you want to. |
I wonder what @jackplug thinks about this. Is it useful to have form's class always available? Or is it unnecessary clutter?
The text was updated successfully, but these errors were encountered: