IMPLEMENTED: Apply default button theme style to all buttons

Currently it’s not possible to set default style like border and box-shadow for muted/info/success/warning/danger buttons and they all have to be set manually.

What I think should happen is that all styles set for “Style - default” should apply to all buttons, and then be overwritten by individual button style. Example filter that do exactly that:

add_filter( 'bricks/theme_styles/controls', 'element_theme_button_style', 10, 1);

function element_theme_button_style($theme_styles_controls) {

	$theme_styles_controls['button']['border'] = [
		'group'	=> 'button',
		'type'  => 'border',
		'label' => esc_html__( 'Border', 'bricks' ),
		'css'   => [
			[
				'property' => 'border',
				'selector' => '.bricks-button',
			],
		],
	];
	
	$theme_styles_controls['button']['boxShadow'] = [
		'group'	=> 'button',
		'type'  => 'box-shadow',
		'label' => esc_html__( 'Box shadow', 'bricks' ),
		'css'   => [
			[
				'property' => 'box-shadow',
				'selector' => '.bricks-button',
			],
		],
	];

    return $theme_styles_controls;
};

And the result where border-radius and box-shadow set for default button is inherited by every button but still can be overwriten.

2 Likes

I second this. Theme Settings - Default should be the default for all button styles, with overrides available on each specific button.

I’ve spent some time trying to work out why the default styles are not applying to buttons placed on my page. Then realise “Primary” gets added as a default setting when placing the button. So frustrating.

2 Likes

@enlive I agree, it’s super strange that there is a default that’s not the default.
It’s also pretty strange that default doesnt set the base styles for the rest.
Why is there a default style at all?

Sounds like a potential future headache to reformat things in future versions if/when this makes more sense.

2 Likes

Agreed. Still shocked this hasn’t been addressed yet. I’d argue it’s a bug when practically everything else in the “default” button style applies except for border radius.

1 Like

Any update on this? Thanks

Hi guys,
We’ve added some more theme style button settings in Bricks 1.11.1, now available as a one-click update in your WordPress Dashboard.

Changelog: Bricks 1.11.1 Changelog – Bricks

Please let us know if you are still experiencing issues.

Best regards,
timmse

1 Like