TODAY I LEARNED

data-scheme to add styles!

If you need to add styles to an element when the page is in dark mode, simply use the data-scheme of the page followed by the class or ID of the element you want to add styles to.

[data-scheme="dark"] .js-subs-text-inputs {
   color: #FFFFFF;
}

Tweet

Learned by ramon-guzman on Apr 13, 2022

Discover our latest blog posts
  • #html-css
  • view raw
  • permalink
  • 2 likes
previous TIL next TIL
  • Log in
  • ?

    TIL is an open-source project by MagmaLabs that exists to catalogue the sharing & accumulation of knowledge as it happens day-to-day. Posts have a 200-word limit, and posting is open to any MagmaLaber as well as selected friends of MagmaLabs. We hope you enjoy learning along with us.

    • /wearemagmalabs
  • statistics
  • search
  • Twitter