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

Issue fork bootstrap5-3474980

Command icon 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

stefan.korn created an issue. See original summary.

stefan.korn changed the visibility of the branch 3474980-align-default-button to hidden.

stefan.korn’s picture

Status: Active » Needs review
jannakha’s picture

Status: Needs review » Needs work

@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!

stefan.korn’s picture

StatusFileSize
new7.23 KB
new14.08 KB
new17.92 KB

@jannakha: Please see screenshots

Claro:
Claro

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

Bootstrap5 with this MR (Preview now Secondary):

BS5 after

stefan.korn’s picture

Status: Needs work » Needs review
fenstrat’s picture

Status: Needs review » Reviewed & tested by the community

This 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.

fenstrat’s picture

Marked #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.

vladimiraus’s picture

Status: Reviewed & tested by the community » Fixed

Thank you all for your contributions. 🎂
Committed.

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.