Skip to content

Commit

Permalink
Merge pull request #3575 from Codeinwp/fix/button_styles
Browse files Browse the repository at this point in the history
fix: button border default and default import #3565 #3570
  • Loading branch information
cristian-ungureanu authored Aug 17, 2022
2 parents 83af82e + 5a5979e commit d1ea8c5
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
8 changes: 4 additions & 4 deletions globals/migrations.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ function neve_get_button_appearance_default( $button = 'button' ) {

return [
'type' => 'fill',
'background' => 'var(--nv-secondary-accent)',
'backgroundHover' => 'var(--nv-secondary-accent)',
'text' => 'var(--nv-text-color)',
'textHover' => 'var(--nv-text-color)',
'background' => 'var(--nv-primary-accent)',
'backgroundHover' => 'var(--nv-primary-accent)',
'text' => '#fff',
'textHover' => '#fff',
'borderRadius' => [
'top' => 3,
'right' => 3,
Expand Down
20 changes: 16 additions & 4 deletions header-footer-grid/Core/Components/Button.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,22 @@ public function add_style( array $css_array = array() ) {
$value = get_theme_mod( $id );

$rules = [
'--primarybtnbg' => [ Dynamic_Selector::META_KEY => $id . '.background' ],
'--primarybtncolor' => [ Dynamic_Selector::META_KEY => $id . '.text' ],
'--primarybtnhoverbg' => [ Dynamic_Selector::META_KEY => $id . '.backgroundHover' ],
'--primarybtnhovercolor' => [ Dynamic_Selector::META_KEY => $id . '.textHover' ],
'--primarybtnbg' => [
Dynamic_Selector::META_KEY => $id . '.background',
Dynamic_Selector::META_DEFAULT => 'var(--nv-primary-accent)',
],
'--primarybtncolor' => [
Dynamic_Selector::META_KEY => $id . '.text',
Dynamic_Selector::META_DEFAULT => '#fff',
],
'--primarybtnhoverbg' => [
Dynamic_Selector::META_KEY => $id . '.backgroundHover',
Dynamic_Selector::META_DEFAULT => 'var(--nv-primary-accent)',
],
'--primarybtnhovercolor' => [
Dynamic_Selector::META_KEY => $id . '.textHover',
Dynamic_Selector::META_DEFAULT => '#fff',
],
'--primarybtnborderradius' => [
Dynamic_Selector::META_KEY => $id . '.borderRadius',
'directional-prop' => Config::CSS_PROP_BORDER_RADIUS,
Expand Down
4 changes: 4 additions & 0 deletions inc/core/styles/css_prop.php
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,10 @@ public static function transform_directional_prop( $meta, $device, $value, $css_
if ( count( array_unique( $filtered ) ) === 1 ) {

if ( neve_value_is_zero( $value['top'] ) ) {
$suffix = '';
}

if ( empty( $value['top'] ) && ! neve_value_is_zero( $value['top'] ) ) {
return '';
}

Expand Down

0 comments on commit d1ea8c5

Please sign in to comment.