[wp-docs] : WordPress-Generated CSS Classes for Menus (Chip

Chip Bennett chip at chipbennett.net
Thu Apr 19 13:01:33 UTC 2012


Tom,

I suppose my thinking is that it is essentially redundant to say, "The
following classes are applied to menu items, i.e. to the HTML <li> tags,
generated by wp_nav_menu():", then to list out those classes by context
(for example, the .current-menu-item class description is, "This class is
added to menu items that correspond to the currently rendered page."), and
then to say, "to target the current page menu item, use .current-menu-item
{}". If I pull all of the related CSS definitions from Twenty Eleven
style.css, I think it will really over-clutter the CSS classes section,
without really providing much additional benefit.

Further, I guess I'm expecting that anyone looking for CSS classes applied
via wp_nav_menu() already has a basic understanding of CSS and HTML.
Perhaps that's not a valid assumption?

I really like Evan's suggestion to put CSS examples in the How-To/Tutorial
article for using custom nav menus. I think they'd be a better fit there,
since they can be given more/better context.

But if we want to go the route of putting the examples in the wp_nav_menu()
function ref, just let me know, and I'll start copy/pasting from Twenty
Eleven. :)

Chip

On Thu, Apr 19, 2012 at 7:33 AM, Tom Auger (personal) <
tomaugerdotcom at yahoo.ca> wrote:

> Hey Chip, in order to better understand your position, I think I'll need
> some clarification on why you don't want some very small examples of the
> CSS
> (you wouldn't need any HTML, since the markup is auto generated by the very
> functions you're documenting). Obviously we do PHP examples all over the
> place, why should it be different for CSS when it's apposite to the topic
> at
> hand?
>
> Just some anecdotal experience here: I have recently hired two new web
> developers, rather fresh out of school, and to them it was quite a mystery
> as to how to highlight selected menu items etc. Of the two, I think one
> could have figured it out given a list of all the classes available, but
> the
> other who was a more visual learner, really needed to be shown once how all
> those classes could be leveraged.
>
> Just in terms of making the documentation as complete as possible, and as
> useful as possible to all viewers of various experience levels, I thought
> it
> might be handy to just give a hint or two of how these classes might be
> leveraged in a real-world scenario.
>
> I do like Evan's suggestion of using examples from the official themes that
> ship with WP. That seems right to me. I guess the only issue there is what
> do we do when Twenty-Twelve ships (looking like 3.5 at the moment, so still
> a few months off)?
>
> Tom
>
> ------------------------------
>
> Message: 2
> Date: Wed, 18 Apr 2012 11:42:16 -0500
> From: Chip Bennett <chip at chipbennett.net>
> Subject: Re: [wp-docs] WordPress-Generated CSS Classes for Menus (Chip
>        Bennett)
> To: WordPress Documentation <wp-docs at lists.automattic.com>
> Message-ID:
>        <CAPdLKqcdgqax9-iejR3-hOaDL36Su4W6D9feoxfFeqKFrSmP=Q at mail.gmail.com
> >
> Content-Type: text/plain; charset="iso-8859-1"
>
> Tom,
>
> I'm conflicted regarding adding basic CSS/HTML markup examples to the
> Codex. Once one knows the classes that are applied to the HTML LI tags,
> using those tags for CSS styling should be fairly trivial. Do we do this
> elsewhere in the Codex?
>
> If need be, we can add examples from Twenty Eleven's style.css...
>
> Chip
>
>
>
> _______________________________________________
> wp-docs mailing list
> wp-docs at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-docs
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.automattic.com/pipermail/wp-docs/attachments/20120419/71cf9718/attachment.htm>


More information about the wp-docs mailing list