Change color of Calendar icon

UI Components for Vue
Post Reply
Pau2000
Posts: 3
Joined: 25 Oct 2022, 20:07

30 Oct 2022, 18:01

I've been trying to change the color of the icon background on the calendar component. It's on blue by dafault and I would like it to be gray.

<Calendar id="icon" placeholder="Check-out" v-model="checkOutDate" :showIcon="true" style="width: 10rem;"/>

Any idea how can I do this?

bahadirsofuoglu
Posts: 84
Joined: 06 Sep 2022, 08:59

31 Oct 2022, 12:52

Hi, You can check this document. Local styling should solve your problem. https://www.primefaces.org/primevue/theming

Spyabo
Posts: 1
Joined: 16 Aug 2023, 11:08

16 Aug 2023, 11:10

I managed to do it by adding a style scoped on to my component to target the icon :)

Code: Select all

<style scoped>
:deep(.p-icon) {
    color: #3a82f6;
}
</style>

bahadirsofuoglu
Posts: 84
Joined: 06 Sep 2022, 08:59

04 Sep 2023, 09:25

Spyabo wrote:
16 Aug 2023, 11:10
I managed to do it by adding a style scoped on to my component to target the icon :)

Code: Select all

<style scoped>
:deep(.p-icon) {
    color: #3a82f6;
}
</style>
This is also a preferred solution. However, we can now customize all components using pt (pass-through). I'm sharing an example for the calendar icon below.

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

Post Reply

Return to “PrimeVue”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest