{"id":353,"date":"2019-10-22T21:08:45","date_gmt":"2019-10-22T21:08:45","guid":{"rendered":"http:\/\/jamesdowen.com\/blog\/?p=353"},"modified":"2019-10-22T21:08:45","modified_gmt":"2019-10-22T21:08:45","slug":"how-to-make-the-most-of-the-dark-mode-craze-using-css","status":"publish","type":"post","link":"https:\/\/jamesdowen.com\/blog\/how-to-make-the-most-of-the-dark-mode-craze-using-css\/","title":{"rendered":"How to make the most of the dark mode craze using CSS"},"content":{"rendered":"<p>This is just a short post, but I had a question through my inbox recently about devices using dark mode. There&#8217;s a large rise in dark mode users across systems like iOS and MacOS especially, but how are websites reacting to this?<\/p>\n<p>Well luckily for developers out there, there&#8217;s an option to run certain CSS when dark mode is detected on a users device.<\/p>\n<pre class=\"lang:default decode:true\">@media (prefers-color-scheme: dark) {\r\n    \/* CSS here *\/\r\n}<\/pre>\n<p>So now we can start inverting our website colours and fitting in with the dark mode craze.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is just a short post, but I had a question through my inbox recently about devices using dark mode. There&#8217;s a large rise in dark mode users across systems like iOS and MacOS especially, but how are websites reacting to this? Well luckily for developers out there, there&#8217;s an option to run certain CSS [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to make the most of the dark mode craze using CSS | James Dowen<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jamesdowen.com\/blog\/how-to-make-the-most-of-the-dark-mode-craze-using-css\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to make the most of the dark mode craze using CSS | James Dowen\" \/>\n<meta property=\"og:description\" content=\"This is just a short post, but I had a question through my inbox recently about devices using dark mode. There&#8217;s a large rise in dark mode users across systems like iOS and MacOS especially, but how are websites reacting to this? Well luckily for developers out there, there&#8217;s an option to run certain CSS [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jamesdowen.com\/blog\/how-to-make-the-most-of-the-dark-mode-craze-using-css\/\" \/>\n<meta property=\"og:site_name\" content=\"James Dowen\" \/>\n<meta property=\"article:published_time\" content=\"2019-10-22T21:08:45+00:00\" \/>\n<meta name=\"author\" content=\"James\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"James\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/jamesdowen.com\/blog\/how-to-make-the-most-of-the-dark-mode-craze-using-css\/\",\"url\":\"https:\/\/jamesdowen.com\/blog\/how-to-make-the-most-of-the-dark-mode-craze-using-css\/\",\"name\":\"How to make the most of the dark mode craze using CSS | James Dowen\",\"isPartOf\":{\"@id\":\"https:\/\/jamesdowen.com\/blog\/#website\"},\"datePublished\":\"2019-10-22T21:08:45+00:00\",\"dateModified\":\"2019-10-22T21:08:45+00:00\",\"author\":{\"@id\":\"https:\/\/jamesdowen.com\/blog\/#\/schema\/person\/51179280d7d76166490e1c27be360931\"},\"breadcrumb\":{\"@id\":\"https:\/\/jamesdowen.com\/blog\/how-to-make-the-most-of-the-dark-mode-craze-using-css\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/jamesdowen.com\/blog\/how-to-make-the-most-of-the-dark-mode-craze-using-css\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/jamesdowen.com\/blog\/how-to-make-the-most-of-the-dark-mode-craze-using-css\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/jamesdowen.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to make the most of the dark mode craze using CSS\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/jamesdowen.com\/blog\/#website\",\"url\":\"https:\/\/jamesdowen.com\/blog\/\",\"name\":\"James Dowen\",\"description\":\"A blog about web development.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/jamesdowen.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/jamesdowen.com\/blog\/#\/schema\/person\/51179280d7d76166490e1c27be360931\",\"name\":\"James\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/jamesdowen.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e4d7008d9ebb77f8de729f655e30d11f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e4d7008d9ebb77f8de729f655e30d11f?s=96&d=mm&r=g\",\"caption\":\"James\"},\"sameAs\":[\"http:\/\/jamesdowen.com\"],\"url\":\"https:\/\/jamesdowen.com\/blog\/author\/jdowen\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to make the most of the dark mode craze using CSS | James Dowen","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/jamesdowen.com\/blog\/how-to-make-the-most-of-the-dark-mode-craze-using-css\/","og_locale":"en_US","og_type":"article","og_title":"How to make the most of the dark mode craze using CSS | James Dowen","og_description":"This is just a short post, but I had a question through my inbox recently about devices using dark mode. There&#8217;s a large rise in dark mode users across systems like iOS and MacOS especially, but how are websites reacting to this? Well luckily for developers out there, there&#8217;s an option to run certain CSS [&hellip;]","og_url":"https:\/\/jamesdowen.com\/blog\/how-to-make-the-most-of-the-dark-mode-craze-using-css\/","og_site_name":"James Dowen","article_published_time":"2019-10-22T21:08:45+00:00","author":"James","twitter_misc":{"Written by":"James"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/jamesdowen.com\/blog\/how-to-make-the-most-of-the-dark-mode-craze-using-css\/","url":"https:\/\/jamesdowen.com\/blog\/how-to-make-the-most-of-the-dark-mode-craze-using-css\/","name":"How to make the most of the dark mode craze using CSS | James Dowen","isPartOf":{"@id":"https:\/\/jamesdowen.com\/blog\/#website"},"datePublished":"2019-10-22T21:08:45+00:00","dateModified":"2019-10-22T21:08:45+00:00","author":{"@id":"https:\/\/jamesdowen.com\/blog\/#\/schema\/person\/51179280d7d76166490e1c27be360931"},"breadcrumb":{"@id":"https:\/\/jamesdowen.com\/blog\/how-to-make-the-most-of-the-dark-mode-craze-using-css\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jamesdowen.com\/blog\/how-to-make-the-most-of-the-dark-mode-craze-using-css\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jamesdowen.com\/blog\/how-to-make-the-most-of-the-dark-mode-craze-using-css\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/jamesdowen.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to make the most of the dark mode craze using CSS"}]},{"@type":"WebSite","@id":"https:\/\/jamesdowen.com\/blog\/#website","url":"https:\/\/jamesdowen.com\/blog\/","name":"James Dowen","description":"A blog about web development.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jamesdowen.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/jamesdowen.com\/blog\/#\/schema\/person\/51179280d7d76166490e1c27be360931","name":"James","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jamesdowen.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e4d7008d9ebb77f8de729f655e30d11f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e4d7008d9ebb77f8de729f655e30d11f?s=96&d=mm&r=g","caption":"James"},"sameAs":["http:\/\/jamesdowen.com"],"url":"https:\/\/jamesdowen.com\/blog\/author\/jdowen\/"}]}},"_links":{"self":[{"href":"https:\/\/jamesdowen.com\/blog\/wp-json\/wp\/v2\/posts\/353"}],"collection":[{"href":"https:\/\/jamesdowen.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jamesdowen.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jamesdowen.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jamesdowen.com\/blog\/wp-json\/wp\/v2\/comments?post=353"}],"version-history":[{"count":2,"href":"https:\/\/jamesdowen.com\/blog\/wp-json\/wp\/v2\/posts\/353\/revisions"}],"predecessor-version":[{"id":355,"href":"https:\/\/jamesdowen.com\/blog\/wp-json\/wp\/v2\/posts\/353\/revisions\/355"}],"wp:attachment":[{"href":"https:\/\/jamesdowen.com\/blog\/wp-json\/wp\/v2\/media?parent=353"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jamesdowen.com\/blog\/wp-json\/wp\/v2\/categories?post=353"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jamesdowen.com\/blog\/wp-json\/wp\/v2\/tags?post=353"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}