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

Change the color of native input's icons when switching to dark theme #3962

Open
MangelMaxime opened this issue Jan 19, 2025 · 1 comment
Open

Comments

@MangelMaxime
Copy link

There is an icon in the far right of the input but using the dark make it is almost impossible to see:

Image

Compared to light theme:

Image

<div class="field">
    <label class="label">Date de début</label>
    <div class="control">
        <input type="date" class="input" value="2024-09-02">
    </div>
    <p class="help"></p>
</div>
@mohammedsharukhh
Copy link

.input[type="date"]::-webkit-calendar-picker-indicator {
filter: invert(0); /* Default for light mode: dark icon */
opacity: 1;
}

@media (prefers-color-scheme: dark) {
.input[type="date"]::-webkit-calendar-picker-indicator {
filter: invert(1); /* Invert to make it white in dark mode */
}
}

this will help you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants