- Issue created by @Anybody
- 🇩🇪Germany Anybody Porta Westfalica
I just saw that there are already places, where this is done very well, e.g. AddToCartForm.php:
/** * {@inheritdoc} */ protected function actions(array $form, FormStateInterface $form_state) { $actions['submit'] = [ '#type' => 'submit', '#value' => $this->t('Add to cart'), '#submit' => ['::submitForm'], '#attributes' => [ 'class' => ['button--add-to-cart'], ], ]; return $actions; }
So we just have to find the missing pieces :)
- 🇩🇪Germany Anybody Porta Westfalica
Okay, here's the first shot. For now to show the expectation and to discuss details.
One thing I'm a bit curious about is that typically
button--XYZ
is a modifier and the button should have "button" as base class? But for example in #2 that's not the case, so I didn't change that yet and used the same naming logic.This might (already in #2) be against BEM.
In that case, we should either add a "button" class or remove the "button--" prefix?I'm quite happy to see possible improvements for themers here with minimal effort on programming side.
- Status changed to Needs review
8 months ago 1:30pm 4 September 2024 - 🇩🇪Germany Anybody Porta Westfalica
Let's do this in general and make the commerce world a bit better for themers :)
- 🇮🇱Israel jsacksick
Why is this categorized as a bug report? This is going to have to wait until we have availability to review this internally...
- 🇩🇪Germany Anybody Porta Westfalica
@jsacksick thanks, my fault. This was initially going into a different direction and then I forgot to change the value. Pardon!