Skip to content

feat: add Button Bold font weight option#789

Open
jjroelofs wants to merge 5 commits into
8.xfrom
jur/8.x/787-add-button-font-weight
Open

feat: add Button Bold font weight option#789
jjroelofs wants to merge 5 commits into
8.xfrom
jur/8.x/787-add-button-font-weight

Conversation

@jjroelofs

Copy link
Copy Markdown
Collaborator

Summary

  • Adds a new "Button Element" section to the Block Design theme settings with a "Button Bold" checkbox
  • When enabled, applies font-weight: bold to .btn elements via the CSS variable --dxt-setting-button-bold
  • Follows the same pattern as the existing headings_bold setting

Changes

  • features/sooper-block-design/block-design-theme-settings.inc: Added button_el details group with button_bold checkbox field
  • features/sooper-settings/css-variables-theme-settings-css.inc: Registered button_bold as a CSS variable and added value massaging (bold/normal)
  • scss/base/variables.scss: Added --dxt-setting-button-bold: normal default
  • scss/vendor-extensions/bootstrap-5.scss: Applied font-weight: var(--dxt-setting-button-bold) to .btn
  • css/: Compiled CSS artifacts

Fixes: #787

Test plan

  • Navigate to Appearance > DXPR Theme > Settings > Block Design > Customize Design > Button Element
  • Verify the "Button Bold" checkbox appears
  • Enable the checkbox, save settings, and confirm buttons render with bold font weight
  • Disable the checkbox, save settings, and confirm buttons render with normal font weight

Adds a "Button Bold" checkbox to the Block Design settings under a new
"Button Element" section. When enabled, buttons get font-weight: bold
via CSS variable --dxt-setting-button-bold.

Fixes: #787
@jjroelofs jjroelofs force-pushed the jur/8.x/787-add-button-font-weight branch from 516403b to 31ce2e4 Compare April 4, 2026 07:22

$form['dxpr_theme_settings']['block']['block_advanced']['button_el']['button_bold'] = [
'#type' => 'checkbox',
'#title' => t('Button Bold'),

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new setting is missing #ai_description. generate-settings-schema.js only includes that metadata when it is present in the PHP form definition, so the generated button_bold schema entry loses the design guidance comparable settings like headings_bold already provide. Worth adding here if this setting is meant to participate in the schema-driven AI workflows.

}

.btn {
font-weight: var(--dxt-setting-button-bold);

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disabled state is not neutral here. DXPR attaches its base libraries after the active subtheme global-styling library, so this unconditional .btn rule overrides same-specificity subtheme button weights. Because --dxt-setting-button-bold defaults to normal, existing subthemes that intentionally set .btn to 500 or 600 will regress even when the checkbox stays off. Can we preserve current behavior in the disabled state instead of forcing normal?

- Add #ai_description to button_bold setting for schema-driven AI
- Change button_bold disabled default from 'normal' to 'inherit' so
  subthemes that set custom .btn font-weight are not overridden when
  the checkbox is off
- Regenerate compiled CSS and settings schema
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Font Weight option to Button element

1 participant