Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Icons in the frontend and performance #5166

Closed
samikeijonen opened this issue Nov 7, 2016 · 26 comments
Closed

Icons in the frontend and performance #5166

samikeijonen opened this issue Nov 7, 2016 · 26 comments
Assignees
Milestone

Comments

@samikeijonen
Copy link
Contributor

samikeijonen commented Nov 7, 2016

There are couple of icons in the frontend which are used as custom font icon or dashicons. We could probably move away from icon fonts and use SVGs only.

  • First example is from checkout page. There we load all dashicons if SSL is around just for padlock icon. We could use SVG icon instead.
  • Second example is the Ok icon before the Added to chart text. We could use SVG for that.
  • Third example is the spinner. We could probably do that with CSS only.

I'm not sure are the icons edd-icon-remove, edd-icon-remove-circle, and edd-icon-ok-circle used anywhere.

I can create PR for this. I do understand that this might have backwards compatibility problems with themes. Another solution is to add some hooks where we can insert icons without JS.

@pippinsplugins
Copy link
Contributor

I like this idea.

I doubt there'd be much BC concern here.

@samikeijonen
Copy link
Contributor Author

Ok. I create PR for this for testing in couple of days.

@pippinsplugins
Copy link
Contributor

Since this does have potential backwards compatibility ramifications, I'm going to milestone it for 2.7.

@samikeijonen
Copy link
Contributor Author

Anybody had time to test this?

@pippinsplugins
Copy link
Contributor

I have not yet but will soon.

@SeanTOSCD
Copy link
Contributor

I was able to test this a bit. The spinner is super slick and the Added to Cart check is working just fine for me. Couple points:

  1. I'm not set up to check the SSL lock so someone else needs to grab that please.

  2. How about the loading.gif usage for the gateway picker switching and discount form submission loading (and probably other places)? I know that's not an icon font. But are we looking to adjust those too or were they intentionally left out?

@samikeijonen
Copy link
Contributor Author

samikeijonen commented Nov 28, 2016 via email

@samikeijonen
Copy link
Contributor Author

@SDavisMedia: In commit 9e23214 there is first pass of replacing loading.gif with the same spinner.

I'm not perfectly happy with small up/down movement in discount code but run out of time for today.

@pippinsplugins
Copy link
Contributor

This is looking great!

The padlock on the CC form is definitely not working though.

Master:
screen shot 2016-12-07 at 2 15 43 pm

Issue branch:
screen shot 2016-12-07 at 2 15 35 pm

@samikeijonen
Copy link
Contributor Author

I try to look into padlock icon. I just need to set up https for testing.

@SeanTOSCD
Copy link
Contributor

@samikeijonen Sorry... forgot to mention I took a look at this during WordCamp US. The replacement for loading.gif looks great but I do agree that the slight up/down movement in the discount area does need to be hit. Could you squeeze that in there too?

@samikeijonen
Copy link
Contributor Author

but I do agree that the slight up/down movement in the discount area does need to be hit.

Agree, I don't like it:) I was actually thinking does the loading spin have to be in the same spot as it use to be? Which is next to title.

Could it be be for example below Apply button? This was just an idea on top of my head at the moment. Not really tested anything.

@SeanTOSCD
Copy link
Contributor

@samikeijonen that was the exact thought I had when I saw it too. I'd rather see it to the right of the Apply button, otherwise we'll still get a page jump, even if it's below the discount form.

@samikeijonen
Copy link
Contributor Author

Sorry, I've been busy.

I'd rather see it to the right of the Apply button

Agreed. But I think we can do this only if we change the markup as <button>Apply (spinner)</button>. Would that be a problem for backwards compatibility?

@SeanTOSCD
Copy link
Contributor

@samikeijonen yea, definitely don't want it inside the button. I was thinking to the right of it but that's probably a bad idea.

Instead, maybe you could try leaving it where it is but absolute positioning it so it doesn't affect the wrapper elements and cause the jerk? The Discount label is already relative positioned so that might work.

@samikeijonen
Copy link
Contributor Author

samikeijonen commented Dec 17, 2016 via email

@samikeijonen
Copy link
Contributor Author

Do we still have time to get this in 2.7?

Sorry I've been too busy to finish this up.

@samikeijonen
Copy link
Contributor Author

samikeijonen commented Jan 3, 2017

I updated the PR #5177.

  1. Padlock icon is working as inline SVG. EDD Stripe was just overwriting it. There is separate PR in https://github.com/easydigitaldownloads/edd-stripe/pull/175.
  2. Apply discount spinner is tricky one. There is no golden CSS that fits for all themes. At the moment spinner is next to Apply button, or below it, depending on theme styles.

@SeanTOSCD
Copy link
Contributor

I just checked out (all pun intended) the discounts spinner using Vendd. It's below the button. Honestly, I don't think it's bad. But it definitely disrupts the page and didn't do that before. This is a tricky one. Is there any way it can be smaller? Are there other options for loading icons? If it's smaller, it can stay where it was originally that way it doesn't make the page jerk.

@samikeijonen
Copy link
Contributor Author

samikeijonen commented Jan 5, 2017

For Vendd I'd modify the theme CSS like this:

#edd_checkout_form_wrap .edd-cart-adjustment #edd-discount {
   display: block;
}

#edd_checkout_form_wrap #edd-discount-code-wrap input.edd-apply-discount {
   display: inline-block;
}

.edd-discount-loader {
   margin-top: 5px;
}

I'm out of ideas how all the changes would not affect in some way for themes out there. But in most cases there should be only small CSS tweaks.

@SeanTOSCD
Copy link
Contributor

I really don't think it's bad below the button. The page is going to jerk anyway as the discount is added to the cart. I'm pretty happy with it.

let's see what @sunnyratilal thinks since he's doing a lot of work on 2.7.

@samikeijonen
Copy link
Contributor Author

And like I said any theme can have the spinner on the right with some CSS.

@cklosowski
Copy link
Contributor

@sunnyratilal @SDavisMedia assigning you two, just as a matter of organization as I work through 2.7.

@sunnyratilal
Copy link
Contributor

I'm happy with the implementation.

@sunnyratilal
Copy link
Contributor

Merged into release/2.7

@sunnyratilal
Copy link
Contributor

Unit tests are breaking

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants