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

Actual help texts are rendered as error, warning, success etc. #1939

Closed
dyve opened this issue Feb 13, 2012 · 7 comments
Closed

Actual help texts are rendered as error, warning, success etc. #1939

dyve opened this issue Feb 13, 2012 · 7 comments
Labels

Comments

@dyve
Copy link

dyve commented Feb 13, 2012

When a form is styled with form control states (http://twitter.github.com/bootstrap/base-css.html?#forms, scroll down a little), all help texts (both help-inline and help-block) take their styling from the control state (error, warning, etc).

However, the example fails to take regular help text into account.

With the current version of Bootstrap, any help text within a control-group with a state class is styled as if it is part of the error message, which is wrong. The help text should be styled as what it is, a help text. The underlying issue here of course is that the messages are using the classes for help.

I made a small demo of the official Bootstrap example with added help-block p's with regular help text. I hope this illustrates the problem:

http://jsfiddle.net/TE7HK/1/ (same goes for help-inline)

I see two possible solutions.

  1. Make a difference between help-inline/help-block and message-inline/message-block. Messages are styled like help texts, but take their colors from a surrounding control-group.error class. This would break compatibility with 2.0.0 as far as colors go, but not the actual display of items. Also, it would introduce 2 new classes (message-inline, message-block).
  2. Add the option to define a help-block and help-inline with an extra class "help", which makes them unaffected by surrounding error, warning, etc.

e.g.

<p class="help-block">I will take the color from my control state. If there isn't any, I'll be styled like help.</p>
<p class="help-block help">You won't see mee turn red because of an error!</p>
<p class="help-block error">I will always be displayed as an error text, regardless of the control state.</p>

After writing this up, I'm in favor of solution #2.

@dyve
Copy link
Author

dyve commented Feb 13, 2012

I clarified text and improved my suggestion #2.

@nkryptic
Copy link
Contributor

I am very much in favor of having this addressed, as it seem like an oversight to not handle the original help-texts when adding error/success messages. I personally am in favor of @dyve's #1 above, as there is a semantic difference between help text for a field and status messages about the entry/submission.

+1

@andriijas
Copy link
Contributor

why dont you guys just make your own class in your less files,

.message-block {
.help-block;
color: #000;
}

The point here being, its too easy to see bootstrap as set in stone, but its so easy to customize for own needs. Think outside of the box.

@nkryptic
Copy link
Contributor

@andriljas, something like what you propose is what I'm doing right now. But, I see it as an area of form rendering that bootstrap should cover by default.

@andriijas
Copy link
Contributor

you could use tooltips for actual help text and help-inline for errors, example: #2161

@andriijas
Copy link
Contributor

What I would like to highlight as an issue though is the fact that you cant put an input into "error state" unless you have the control group markup in place. But Im not sure its something bootstrap should solve out of the box.

@mdo
Copy link
Member

mdo commented Mar 12, 2012

Punting discussion to @dyve's pull request, #2173. No matter what, we need to revisit how we handle these errors and it will have to wait until a larger version bump I'm afraid. We'll do our best though!

@mdo mdo closed this as completed Mar 12, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants