Problem/Motivation
Bootstrap5 assigns the class "btn-primary" to every input that has class "button" and does not have the class "btn" or "btn-danger". So basically most buttons from Drupal core get displayed as primary buttons. In contrast Drupal core does usually assign only one button as primary for each form and the other buttons while not explicitly stated are displayed as secondary buttons.
Bootstrap should imho align to this defaults in using button styles.
Additionally Bootstrap5 does explicitly exclude the add more buttons from getting a default button style, resulting in a kind of "camouflage" style for the add more button. I would propose to let the add more button get the default button style too (which will be secondary button with this issues changes then).
Steps to reproduce
Use bootstrap5 for node editing and compare the button styles with for example using claro for node editing.
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | bs5_buttons_after.jpg | 17.92 KB | stefan.korn |
| #6 | bs_buttons_before.jpg | 14.08 KB | stefan.korn |
| #6 | claro_buttons.jpg | 7.23 KB | stefan.korn |
Issue fork bootstrap5-3474980
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:
- bootstrap5-3474980
changes, plain diff MR !74
- 3474980-align-default-button
compare
Comments
Comment #4
stefan.kornComment #5
jannakha commented@stefan.korn
can you please provide screenshots before/after of the MR, and Claro example you've described in the issue.
This will make it easier and faster to confirm the issue and review solution.
thank you!
Comment #6
stefan.korn@jannakha: Please see screenshots
Claro:

Bootstrap5 without this MR (notice both Save and Preview are primary):

Bootstrap5 with this MR (Preview now Secondary):
Comment #7
stefan.kornComment #8
fenstratThis is good to go.
This btn-primary class being added to everything comes from #3249388: Styling update - it seems hard to see why it would have been intentional.
The field-add-more-submit changes came from #3190309: Replace v4 with v5 library and also seem unintentional and makes sense to remove.
Comment #9
fenstratMarked #3438965: Primary buttons are the same color as other buttons as a duplicate of this as it takes exactly the same approach, but is just missing the "Add more" changes that are included here.
Comment #10
vladimirausThank you all for your contributions. 🎂
Committed.