Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SplitButton: Prop Style not working #6633

Closed
xiscohv opened this issue Oct 24, 2024 · 3 comments
Closed

SplitButton: Prop Style not working #6633

xiscohv opened this issue Oct 24, 2024 · 3 comments
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@xiscohv
Copy link

xiscohv commented Oct 24, 2024

Describe the bug

When adding the prop style with background or color does not work. By default gets the background and color of the internal buttons and does not override.

Reproducer

https://stackblitz.com/edit/giaqdp?file=src%2FApp.vue

PrimeVue version

4.1.1

Vue version

4.x

Language

TypeScript

Build / Runtime

Vue CLI App

Browser(s)

ALL

Steps to reproduce the behavior

  1. In the button it works
    https://stackblitz.com/edit/eidbio?file=src%2FApp.vue
  2. In the splitbutton does not work
    https://stackblitz.com/edit/giaqdp?file=src%2FApp.vue

To reproduce it add :style="{ backgroundColor: 'red' }" to any SplitButton.

Expected behavior

Change the css property to the entire component.

@xiscohv xiscohv added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Oct 24, 2024
@xiscohv xiscohv changed the title Component Name: Style on splitbutton SplitButton: Prop Style not working Oct 24, 2024
@betavs
Copy link
Contributor

betavs commented Oct 24, 2024

    <SplitButton
      label="Save"
      @click="save"
      :model="items"
      :style="{ backgroundColor: 'red' }"
      :buttonProps="{ style: { backgroundColor: 'red' } }"
      :menuButtonProps="{ style: { backgroundColor: 'red' } }"
    />

@xiscohv
Copy link
Author

xiscohv commented Oct 24, 2024

That works! Thank you! Is there a way to change the color of the button/splitbutton conserving the hover, click, etc?

@betavs
Copy link
Contributor

betavs commented Oct 24, 2024

That works! Thank you! Is there a way to change the color of the button/splitbutton conserving the hover, click, etc?

Reset button/splitbutton css variables, for example: --p-button-primary-background

@xiscohv xiscohv closed this as completed Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

2 participants