WordPress.org

Forums

Strange WP naming for CSS classes (2 posts)

  1. Tomas Mackevicius
    Member
    Posted 4 years ago #

    It really doesn't add clarity :)

    Dash vs underscore and use of "item"

    cat-item (dash)
    page_item (underscore)

    current-cat (dash, no -item)
    current_page_item (underscore)

    current-cat-parent (dash)
    current_page_parent (underscore)

    (no such class for category?)
    current_page_ancestor

    Is this a common agreement that page classes should go with underscore? Just my thoughts :)

  2. esmi
    Forum Moderator
    Posted 4 years ago #

    There does seem to be a mixture of hyphen and underscores in class names. I can only suppose that some of these are historical. The newer menu items, for example, use hyphens. I know I prefer that to underscores.

Topic Closed

This topic has been closed to new replies.

About this Topic