Problem/Motivation
See #3281151: Remove extra margin on 'add paragraph' button on claro, the class is added to the button element, if modules like paragraphs are doing something arguably weird, button might not actually be a button.
It would IMHO be better if \Drupal\Core\Field\WidgetBase::formMultipleElements() would already set that button class instead of claro adding it itself, then other themes don't have to duplicate that.
Possible problems:
* Is it an API change to move a class like that? Nothing will change for any widget that does not replace the button, but for widgets that do, it will change back to a large button.
* If and how it will affect seven
Steps to reproduce
Proposed resolution
Remaining tasks
* Create the patch to move that class from claro_preprocess_field_multiple_value_form() to the widget
* Create screenshots for seven for a regular multi-value widget
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#15 | 3292488-15.patch | 1.19 KB | _utsavsharma |
#15 | interdiff_3-15.txt | 763 bytes | _utsavsharma |
#7 | 3292488-afterpatch.jpg | 6.41 KB | gaurav-mathur |
#7 | 3292488-beforepatch.jpg | 4.94 KB | gaurav-mathur |
#3 | Screenshot_moveClassFromClaroThemeToWidget_CLARO_after.png | 11.51 KB | romina_ferrario |
Issue fork drupal-3292488
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
BerdirComment #3
romina_ferrario CreditAttribution: romina_ferrario commentedmove class button-small from claro_preprocess_field_multiple_value_form() to the widget
Comment #4
rymcveighJust noting that the patch supplied in #3 will not apply when I attempt to apply it to Drupal version 9.4.5 via composer.
Comment #6
gaurav-mathur CreditAttribution: gaurav-mathur at Dotsquares Ltd. commentedComment #7
gaurav-mathur CreditAttribution: gaurav-mathur at Dotsquares Ltd. commentedI apply patch #3 and it is work fine in claro.
Comment #8
smustgrave CreditAttribution: smustgrave at Mobomo commentedThis looks like a good change and not breaking anything.
Also verified still applies to 10.1.x also.
Comment #10
smustgrave CreditAttribution: smustgrave at Mobomo commentedMoving back as appears to be random failure for 9.5
Comment #13
BerdirRandom test fail again I think.
Comment #14
lauriiiI think we could use the
#button_type
render array key instead. With that this would be just a render array change which is acceptable in a minor.Comment #15
_utsavsharma CreditAttribution: _utsavsharma at OpenSense Labs for DrupalFit commentedTried to address the pointer in #14.
Comment #18
Prashant.cAdded
'#button_type' => 'small'
, kept the attributesRaised a MR, changes needs to be reviewed.
Thanks!
Comment #19
smustgrave CreditAttribution: smustgrave at Mobomo commentedSeems the change at line 281 is out of scope. And issue summary mentions screenshots of a multi value widget which should be added to the user interface section of the summary
Comment #20
BerdirThere is no change in core *if* you use Claro, we just move the class. Other themes that currently don't override it like that might change though. I suppose we could compare the backend with another theme, but not even sure which one?