-
Hi! I'm trying to change the accent color of my React project using DayPicker following the documentation provided. My css file is hooked up correctly and when I've modified other classes through the CSS file, it works. However, when I try to modify the accent color, it doesn't change. See code below:
Other classes I've modified work, for example: But I'm unable to modify the accent color. Is there something I'm typing wrong at the top that isn't grabbing the accent color selector? Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 9 replies
-
Hi @leeshiela, |
Beta Was this translation helpful? Give feedback.
-
Hi, thanks for writing. I tried that initially and it also didn’t work. I
changed it to .rdp when I was reading past discussion posts.
…On Wed, Jul 30, 2025 at 4:46 PM Rodolfo Gobbi De Angeli < ***@***.***> wrote:
Hi @leeshiela <https://github.com/leeshiela>,
The CSS variables are defined in the .rdp-root class, link to docs
<https://daypicker.dev/docs/styling#css-variables>.
Check if using .rdp-root works.
—
Reply to this email directly, view it on GitHub
<#2810 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFBAO63S2V7YZWFSMWYEM5L3LEVMBAVCNFSM6AAAAACCX7IVKSVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTGOJTHA3DGNQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Thank you! In my project files, I have the global css file defined at the
very top level and the day picker style sheet defined in the child
component files. If the imports are not in the same file, how does that
work as I’m still getting an error in my project files.
…On Thu, Jul 31, 2025 at 2:33 PM Rodolfo Gobbi De Angeli < ***@***.***> wrote:
Cool, I see now.
So, the issue is the import order, you should import like this:
import { DayPicker } from "react-day-picker";import "react-day-picker/style.css";import "./styles.css";
The result in the browser:
image.png (view on web)
<https://github.com/user-attachments/assets/612faba4-93ad-4ecc-861d-206291079234>
In CSS, if two or more selectors have the same specificity, the one
defined last will have the styles applied.
When importing default styles, you should import the external default
styles first.
—
Reply to this email directly, view it on GitHub
<#2810 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFBAO66BYTHTP2TRZWKIVTL3LJOPDAVCNFSM6AAAAACCX7IVKSVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTGOJVGA4DANQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
If needed, you can use the following CSS trick to increase the specificity of a class without changing the rendered HTML markup :