DEV Community

Discussion on: Dark theme for dev.to?

Collapse
 
ben profile image
Ben Halpern

We will add this feature. Not sure the timeline. Probably not before we open-source, and at that point the resource constraints will have a different look to them.

In order to add the dark theme, we'll first want to re-configure and refactor our SCSS to be reliant on more variables, and change variables like $black to $text-color and $background-color, etc. Or alternately we could make a file that loads at the end with lots of !importants. But that could be messy.

And then we'll need to decide how this is handled at the CDN layer. Should be the easy part, but it's not as simple as putting a variable in the code.

Some reading about that general subject:

fastly.com/blog/best-practices-usi...

fastly.com/blog/using-esi-part-1-s...

πŸ™‚

Collapse
 
maxart2501 profile image
Massimo Artizzu

Whatever you do, please make it so dev.to remains blazing fast. I love how fast it is. I'd hate to see flashes of white backgrounds when navigating.

I trust you guys on this! πŸ’ͺ

Collapse
 
ben profile image
Ben Halpern

Yep, that's why it would be baked in at the CDN layer with varnish cache, basically at the edge cache, the request would be aware of your settings via cookies and serve the page based on that info. Every time you do this, you split the requests and end up with fewer cache hits, but anything that affects all users like this is fine. If it was thousands of individual configurations, it wouldn't work. But shared configurations like this are perfectly suitable for this approach.

It's technically pretty straightforward, but it's definitely not as simple as if we weren't edge-caching like this.