Easy-digital-downloads: <legend> output in forms

Created on 6 Jul 2015  路  51Comments  路  Source: easydigitaldownloads/easy-digital-downloads

It is my understanding that a <fieldset> should only have one <legend> and that should be the first child element. Legends are currently wrapped in a <span>, so they're not the first child.

The fieldset and legend form a pair. The legend is the "caption" for a particular fieldset. You can have multiple <fieldset> elements, each with their <legend>, within a single <form> (e.g., would do this in the profile editor form).

I'm just bringing this up because how the <legend> element is done in the plugin messes up the design in every one of my themes.

I see two good options:

  • Remove the <span> wrapped on <legend> elements and create extra <fieldset> elements in forms with multiple <legend> elements.
  • Drop the <legend> element altogether and opt for an <h2> or something like that.

I tried to do a little research on this because I've never seen legends handled like this before. Here's some specs:

scope-ui type-bug

Most helpful comment

Marketify keeps its spans, even on issue branch 3568, and looks fine.
selection_420

It looks like they moved them inside the legend though.

All 51 comments

Thanks for the report @justintadlock!

Tagged for 2.4.3.

I vote we drop the span tags as that will have the least impact on existing styles.

@SDavisMedia could you give this a quick test in your themes to make sure no styling is broken?

It's definitely making a difference. Gonna look at some CSS now to see what it'll take to correct.

I didn't see any differences in Twenty Fifteen. Also confirmed that EDD core doesn't style off of the span tags.

I'm seeing Twenty Fifteen changes, the same changes I see in Vendd. I don't style off the span either. There's something going on here. What does the "Personal Info" legend text look like for you? Like this? http://glui.me/?i=85aki7ys6m7ktyl/2015-08-12_at_2.54_PM.png/ If so, compare it with master and let me know if you see a difference.

Maybe it's coming from theme styles.

I'll check again.

Punting to 2.5 since there are apparent style changes. Can't make style changes in a point release.

I'll study this again this weekend.

:+1:

Would definitely break Marketify.

@spencerfinnell so that we have more to go off of, could you show me how it breaks?

Just styles, but would definitely require an update.

http://www.screensnapr.com/qs4v0jn0xpnb

vs

http://www.screensnapr.com/3ur8ybbpxivz

That being said, the extra element definitely helps our styling. Switching the spans to the inside would help us, but would still require an update.

Depending on timing we could make any changes for Marketify 2.0.0. Is there a timeline for 2.6?

@spencerfinnell 2.6 is months out. Maybe Jan or Feb of 2016. If you could do an update before hand to help us make the transition, that'd probably be best.

Yep, I'll add some compatibility to 2.0.0 that assumes the outer spans will be removed eventually.

@SDavisMedia @pippinsplugins looks like @spencerfinnell got this done anticipated us making changes, can we get this going to so we can make the 'breaking' change in 2.6? I'd hate to put this off for another major version.

Let's get the pull request up to date (if not already) and then start testing our own themes. @SDavisMedia could you do a round of testing? We'll need to do this ASAP so we can announce it and give a heads up through the dev blog.

Got it.

@SDavisMedia I've updated the branch issue/3568 with the latest from release/2.6 so go ahead and test out.

okay will do

I see the spans on master, see them removed properly on issue/3568 and in Vendd they still look good.
selection_417

We'll need to test with all of the major themes:

  • Vendd
  • Shoppette
  • Marketify
  • SquareCode
  • Stocky
  • Digital Store (discontinued but still used)

Rock on, away I go

In Shopette, without the span the legend moves up and straddles the div edge.

With span:
selection_418

Without span:
selection_419

@SDavisMedia Could you take care of that in Shoppette?

Marketify keeps its spans, even on issue branch 3568, and looks fine.
selection_420

It looks like they moved them inside the legend though.

Digital Store moves the legend up to straddle the border when the spans are removed.

With:
selection_422

Without:
selection_423

Honestly I don't think it's a problem with this theme, I'd leave it.

@topher1kenobe make issues and assign me on the repos of the themes you have problems please.

SquareCode looks exactly the same with and without spans.

selection_424

selection_426

Stocky makes the legend move up to straddle the border when there's no span.

selection_427

selection_428

Excellent. Let's also go ahead and do a round of tests on the last three default WP themes please.

I just wanted to confirm that the changes have fixed my original issue posted. Nice work! Now, I need to get back to work on the EDD theme I'm building. :)

:)

There are still a few themes that need to be updated (that we know of) but I'm going to go ahead and merge this into release/2.6 to ensure it gets as much testing as possible.

Merged into release/2.6 but leaving open with Needs Testing for additional testing.

There should be a dev blog post about this

I've made adjustments to Vendd, Shoppete, Lattice, and Digital Store. Quota already controlled these styles. All of the theme updates will go out before EDD 2.6. All changes are backwards compatible.

Stripe has to be deployed at the same time as this: https://github.com/easydigitaldownloads/edd-stripe/issues/108

I'm gonna go ahead and push an update to all of the themes. They will all be fine with both the old markup and the new markup.

2014 looks fine in my opinion.
selection_439

2015 looks fine.
selection_440

2016 is good.

selection_441

@justintadlock started this ticket because he's working on a new EDD theme, I'm talking to him about testing that as well.

2013 is good.
selection_443

2012 is good.

selection_444

2011 is good.
selection_445

2010 is good.
selection_446

Basically it looks great on all themes that leave default styling. I'm going to call this one tested and done.

All EDD themes are updated.

I think we go ahead and close this :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DevinWalker picture DevinWalker  路  6Comments

colomet picture colomet  路  4Comments

boluda picture boluda  路  4Comments

SDavisMedia picture SDavisMedia  路  3Comments

JeroenSormani picture JeroenSormani  路  5Comments