themehybrid / hybrid-core

Official repository for the Hybrid Core WordPress development framework.
GNU General Public License v2.0
689 stars 144 forks source link

Identify and modify areas that need to be HTML5 #16

Closed justintadlock closed 11 years ago

justintadlock commented 11 years ago

I think we've all moved to HTML5 as theme developers now. Any HTML in Hybrid Core should be HTML5 by default. So, we need to identify all code that needs to change.

jayj commented 11 years ago

Here's my list:

ryanve commented 11 years ago

@jayj Nice list.

justintadlock commented 11 years ago

Thanks for identifying some major areas. Just some thoughts on the feedback thus far:

hybrid_site_title and hybrid_site_description

These were never intended to be used with HTML5. Honestly, there's no point in using the functions in an HTML5 theme. Their purpose is to output h1 and h2 tags when appropriate pre-HTML5.

[nav-menu]

I'll probably continue using a 'div' instead of 'nav' here. This should reflect the WordPress default and not make the assumption that the menu is not just a regular list.

Maybe the default sidebar arguments in sidebars.php

I'd really love some feedback on the best structure for sidebars. I've seen varying uses. It's something I'll be researching more myself too.

jayj commented 11 years ago

In Cakifo, I use aside for the widgets in the sidebars but div for some of the other widget-areas. I don't know if the aside would be more appropriate for the others. The default themes and _s use asides for the widgets.

aside is now acceptable for secondary content when not nested within an article element."

justintadlock commented 11 years ago

The more I look at it, the more this seems to be the best way to mark up a sidebar:

<aside id="sidebar">

    <section class="widget">

        <h1 class="widget-title">
        </h1>

        <!-- widget content -->
    </section>

    <!-- repeat for each widget -->

</aside>

Or:

<aside id="sidebar">

    <div class="widget">

        <h1 class="widget-title">
        </h1>

        <!-- widget content -->
    </div>

    <!-- repeat for each widget -->

</aside>
madalinignisca commented 11 years ago

I vote for this one:

2013/1/14 Justin Tadlock notifications@github.com

Madalin Ignisca frontend web developer http://imadalin.ro/

ryanve commented 11 years ago

Use h3 for the .widget-title. Using "headings of appropriate rank for the nesting level" is more resilient than using h1 everywhere. Hierarchy should be apparent without CSS. Ranked headings facilitate screenreader tabbing.

Sections may contain headings of any rank, but authors are strongly encouraged to either use only h1 elements, or to use elements of the appropriate rank for the section's nesting level.

I agree about using <section class="widget"> rather than <div class="widget"> based on the rational that it is an explicit section. I'd wrap the .widget-content and add .sidebar for easier styling.

<aside id="sidebar" class="sidebar">
    <section class="widget">
        <h3 class="widget-title"></h3>
        <div class="widget-content"></div>
    </section>
</aside>
jayj commented 11 years ago

I think I agree with option 1 as well. While I don't think the section is the best option for all widgets it's the best option as I see it.

Option 1 gives the following document outline:

Option 2:

The Navigation Menu widgets gives the option to set a container (div or nav). Would it be possible to use this choice in before_widget and after_widget for that specific widget?

justintadlock commented 11 years ago

For now, we'll agree on this structure:

<aside id="sidebar">
    <section class="widget">
    <h3 class="widget-title"></h3>
    </section>
</aside>

Of course, <aside> is handled by the theme itself.

The Navigation Menu widgets gives the option to set a container (div or nav). Would it be possible to use this choice in `before_widget` and `after_widget` for that specific widget?

I wish I'd thought of that. It makes total sense and should definitely be doable similar to how the Bookmarks widget is done.

justintadlock commented 11 years ago

Proposed [gallery] shortcode default markup (Cleaner Gallery extension):

<div class="gallery">

    <!-- repeat for each row -->
    <div class="gallery-row">

        <!-- repeat for each image -->
        <figure class="gallery-item">

            <!-- probably need this wrapper for back-compat -->
            <div class="gallery-icon">
                <img />
            </div>

            <figcaption class="gallery-caption">
            </figcaption>

        </figure>

    </div>
</div>
dronix commented 11 years ago

@jayj has a nice list. I use my own version of hybrid_site_title and hybrid_site_description.

For the sidebar I use the same markup as the Twenty Twelve theme and _s theme as @jayj mentioned.

<section id="sidebar" class="widget-area">
    <aside class="widget">
      <h3 class="widget-title"></h3>
    </aside>
</section>

The [gallery] shortcode markup looks good.

samikeijonen commented 11 years ago

This is interesting conversation. And as @dronix pointed out Twenty Twelve is using kind of opposite markup what is suggested to use in Core. What is the reason Twenty Twelve is using it that way?

pdewouters commented 11 years ago

have you seen this http://html5doctor.com/downloads/h5d-sectioning-flowchart.png

pdewouters commented 11 years ago

sidebar widget should be an article element comments should be article elements

could use 'keywords' for tags (http://schema.org/BlogPosting)

samikeijonen commented 11 years ago

@pdewouters yes I have but it really doesn't answer to my question. Atleast not for me if it's ok to use markup in both ways. Just trying to understand the HTML5 definitions and they are not 100% clear to me yet.

pdewouters commented 11 years ago

@samikeijonen I wasn't replying to your question, just posting that as a reference :)

pdewouters commented 11 years ago

seems there's a new

element http://www.sitepoint.com/html5-main-element/

justintadlock commented 11 years ago

I think most of the things brought up in this ticket dealing directly with Hybrid Core have been addressed. Some things, we'll have to do on a theme level.

Please do let me know if you run into anything else. I'll leave this ticket open for now.

justintadlock commented 11 years ago

I just pushed an update for HTML5 input types in the comment form. That should be the last of the things I plan on updating mentioned in this ticket.