Using v-bind Style PrimeVue Component

UI Components for Vue
Post Reply
Posts: 2
Joined: 25 Oct 2022, 13:27

10 Nov 2022, 17:49

Hi I'm attempting to style a Dialog component header using v-bind in the parent component. I'm able to style the header if v-bind is not used and the style attribute is 'hard-coded'. Using v-bind I can see the vue css var is being added to the header but its value is undefined. Any ideas on how to get this working?

I'm using vue 3.2.33 and primevue 3.12.5

Code: Select all

  <Dialog v-model:visible="show">
  const secondaryColor = ref("49, 97, 115, 1");

  const show = true;

  /* dialog header styling does not work */
  div.p-dialog div.p-dialog-header {
    background-color: rgba(v-bind("secondaryColor"), 1);
    color: #fff;

  /* dialog header styling works */
  div.p-dialog div.p-dialog-header {
    background-color: rgba(49, 97, 115, 1);
    color: #fff;

Posts: 30
Joined: 06 Sep 2022, 08:59

07 Dec 2022, 09:34

Hi, You should use 'deep' for overriding component styles. You can find a sample in local styling section

Post Reply

Return to “PrimeVue”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests