Formtastic should not define element colors in it's stylesheet #914

pehlert opened this Issue Jan 28, 2013 · 5 comments


None yet
3 participants

pehlert commented Jan 28, 2013

Formtastic overrides the global text color setting for legend, which in my opinion is not desirable.



sobrinho commented Jan 28, 2013

I'm almost sure that inherit will use the "previous last" definition color.

If you define your own color on body and use inherit on legend, the legend will use the body color.

At least on Safari, Chrome and Firefox, not sure about the others.

pehlert commented Jan 28, 2013

But what is the point of hardcoding it in the formtastic stylesheets, so that the user has to set it back to inherit?


sobrinho commented Jan 28, 2013

I'm almost sure that if you not specify a color on legend, the browser will use #000 regardless of the color on body.

I don't remeber the reason to be hardcoded #000 on formastic itself, I've always replaced the color on my own stylesheet.

Maybe @justinfrench remember :)

pehlert commented Jan 28, 2013

I haven't done cross-browser testing, but at least in Chrome it seems to inherit it's value from the parent elements as one would expect.


justinfrench commented Jan 28, 2013

That part of the stylesheets are there as part of the CSS reset so that your app's styles can't cause inconsistencies when using Formtastic's CSS. The reset was lifted almost entirely from YUI 2's CSS reset, with each rule modified to scope to .formtastic. You can see the exact same rule in YUI 2's reset:

I can't tell you exactly why it's in the reset, other than YUI's engineers felt it was important, and I was leaning on their work. Perhaps there's a browser that had to be handled a little more forcefully with a more specific color.

I'm not inclined to change it (especially in a point release) without first understanding why it's there. Closing for now, happy to re-open if someone has time to go down the rabbit hole.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment