WordPress.org

Support

Support » Requests and Feedback » Strange WP naming for CSS classes

Strange WP naming for CSS classes

  • 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 🙂

Viewing 1 replies (of 1 total)
  • esmi
    Forum Moderator

    @esmi

    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.

Viewing 1 replies (of 1 total)
  • The topic ‘Strange WP naming for CSS classes’ is closed to new replies.