Skip to content

Add ability to update/override pseudo for input search #16

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

Closed
chiefpansancolt opened this issue Nov 25, 2020 · 2 comments
Closed

Add ability to update/override pseudo for input search #16

chiefpansancolt opened this issue Nov 25, 2020 · 2 comments
Assignees

Comments

@chiefpansancolt
Copy link

In input search, once words are typed an x shows up but when dark mode is used the x is not visible due to color, but there is no way to update this during the dark mode.

@cdock1029
Copy link

cdock1029 commented Dec 12, 2020

I got this to work for Chrome, you can tweak the brightness or use other filters...

/*  scss / postcss nested syntax */
html.dark {
    input[type='search']::-webkit-search-cancel-button {
      filter: grayscale(1) brightness(1.5);
    }
    input[type='date']::-webkit-calendar-picker-indicator {
      filter: invert(1);
    }
  }

Here's a tip to be able to debug some of these pseudo elements:

https://stackoverflow.com/questions/20804016/editing-input-type-search-pseudo-element-button-x#answer-58484957

@RobinMalfait RobinMalfait self-assigned this Feb 21, 2022
@RobinMalfait
Copy link
Member

Hey! Thank you for your suggestion!
Much appreciated! 🙏

As @cdock1029 mentioned you can use those selectors already. We might make this easier in the future but since this is already possible I'm going to close this issue for now.

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

3 participants