Skip to content

Instantly share code, notes, and snippets.

@DominikPeters
Created December 20, 2021 21:54
Show Gist options
  • Save DominikPeters/bcf40d928cfe6311c3f2c7e28328d046 to your computer and use it in GitHub Desktop.
Save DominikPeters/bcf40d928cfe6311c3f2c7e28328d046 to your computer and use it in GitHub Desktop.
Styling the ⤫ cancel button of input[type=search] for dark mode in Chrome and Safari
/* Makes the clear/cancel/delete button bright instead of dark when in dark mode */
@media (prefers-color-scheme: dark) {
input[type="search"]::-webkit-search-cancel-button {
filter: invert(1);
}
}
@DominikPeters
Copy link
Author

Top: normal, bottom: with style.

image
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment