[wp-hackers] CSS backwards compatibility in Admin
Andrew Ozz
admin at laptoptips.ca
Wed Nov 5 17:07:15 GMT 2008
Stephen Rider wrote:
> I've noted that in the Admin for 2.7, the submit buttons on Admin pages
> now have a class="button-primary" assigned.
>
> The visual difference is that with this class, the button is a medium
> blue color, and without it (presumably for "secondary" buttons) the
> color is a faded gray.
>
> For the sake of both a) cleaner code, and b) backwards compatibility
> with plugins, shouldn't this be reversed?
>
> That is, buttons should be blue by default, and IF there is a
> class="button-secondary" then it is the faded gray? Surely the
> secondary buttons are the special case here, as most forms have a
> single, primary, button.
>
> Not a major thing, but again one more silly little thing for plugin
> authors to have to go back in and change to make their plugins match the
> current look of admin. When making these changes, it's good to keep in
> mind what happens to existing code.
Actually there are 3 classes for buttons now:
.button has feint gray gradient (very feint, may need to make it a
little stronger),
.button-primary with blue-green gradient meant for emphases, one or two
per page, usually the "main" button,
.button-secondary has the same gradient like .button but different
border/highlighting meant for use in areas with background color.
All existing .button and .button-secondary from 2.5/2.6 are still used
at the same places. The new .button-primary can be used to emphasis the
main action on a page, like the "Publish" button on the write page, or
to draw attention to certain action.
More information about the wp-hackers
mailing list