magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

Unnecessary overruling of default UI element in certain pages

Open gs-mancs opened this issue 11 years ago • 7 comments

There are certain elements in the UI that should be left unmodified regardless of where they are, and instead if necessary modified with extra classes.

Check this less file: https://github.com/magento/magento2/blob/develop/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/checkout/_payments.less#L42 Line 42 basically makes all .action.primary button elements (by default the standard highlighted button, in default template, color blue) twice as big, on the second page of the checkout (billing address section)

It applies the rule if a specific parent element is in place. (.checkout-payment-method, this block contains all the form elements in this section) Instead of using the button-l class in the template (on the button) which is already defined is less.

This modification is really frustrating for module development: I want to stick to the base UI elements, without having to do custom classes on specific pages to force-resize the UI element back to it's default state. I need to insert a standard UI button into both Shipping & Billing parts of the checkout; for shipping there's no such overruling & everything is sweet, however with Billing this immediately pops in.

From the css selector affecting all buttons in that part of the checkout, I can also see that this issue applies to several other pages too.

Sadly I'm not sure how I can contribute to solving this issue; this is generally a bad practice (not caring about anyone later wishing to extend the interface under a significantly sized content part) and possibly would require changing several templates & less files.

Thanks in advance, and I would welcome any feedback. (or any ways css rules to force the standard button size?)

gs-mancs avatar Aug 17 '15 16:08 gs-mancs

Hi @blindmancs!

We avoid using presentational classes like “button-l”, because they can be really theme-specific. For example, in the Blank theme the “place order” button looks twice as big, in other theme it would have the same size as all theme buttons or look like an icon.

However, in the case with the “place order” button we can make the selector more specific in the way, when the button-l style will be applied only to the primary button that is placed in .payment-method-content > .actions-toolbar > .primary .action.primary, so it shouldn't affect your module's button - will this help?

zanilee avatar Aug 19 '15 07:08 zanilee

Yup I took a look and that's exactly what happens on the Shipping part. This update would be really helpful for us. :+1: Do you want me to do a quick branch on this, or would you guys handle it?

Thanks!

gs-mancs avatar Aug 19 '15 10:08 gs-mancs

We'll handle it. Internal ticket MAGETWO-41842

zanilee avatar Aug 19 '15 14:08 zanilee

The fix is in the mainline now. @blindmancs, did it solve your problem?

zanilee avatar Sep 22 '15 12:09 zanilee

@blindmancs , Are you still able to reproduce this issue?

okorshenko avatar Sep 24 '15 09:09 okorshenko

I'll try to get back to this. Currently my module (which runs perfectly on 1.0.0-beta) causes some internal error. No error reporting by M2 / apache, so I'm trying to figure out what's happening. (It does look like an M2 error, as the header & footer shows up)

gs-mancs avatar Sep 24 '15 10:09 gs-mancs

Hi @okorshenko, Thanks for keeping an eye on this. I can confirm that the button doesn't have the special css rules for that whole section of the checkout. (anymore)

Lovely fix, definitely made my life easier!

gs-mancs avatar Sep 28 '15 12:09 gs-mancs