Putting that directly into the HTML wouldn't work per se, but along the lines of my initial implementation, this should work if done along the lines of how this has been implemented.
How this currently works:
User has stored config as attributes on the model's table
Config is served async and stored in localstorage, same as how we do other stuff like user profile
Inline script modifies html (render-blocking, but no network latency because inline).
Currently I quick-and-dirty did it via the body class. I should have waited but I was pretty excited to get something out and I was slightly confused about this part but have more clarity now. I'll modify this to use :root and explain how it's done.
I'll make a detailed DEV post once this is in place.
Another question we need to ask is will users be able to set all the variables themselves or just have a few premade themes to choose from?
There are bits that won't look quite right with this implementation but if people raise issues saying, 'this bit looks off', it will be easy enough to track down the style and sort it.
Thank you, it's my first 'real' development job, better late than never 😀
I think we can build towards letting folks set their own variables, but let's start by collectively working towards a shared concept of night mode and open things up once we've crossed that bridge.
Putting that directly into the HTML wouldn't work per se, but along the lines of my initial implementation, this should work if done along the lines of how this has been implemented.
How this currently works:
Currently I quick-and-dirty did it via the body class. I should have waited but I was pretty excited to get something out and I was slightly confused about this part but have more clarity now. I'll modify this to use
:root
and explain how it's done.I'll make a detailed DEV post once this is in place.
And congrats on the new job Andrew!
Another question we need to ask is will users be able to set all the variables themselves or just have a few premade themes to choose from?
There are bits that won't look quite right with this implementation but if people raise issues saying, 'this bit looks off', it will be easy enough to track down the style and sort it.
Thank you, it's my first 'real' development job, better late than never 😀
I think we can build towards letting folks set their own variables, but let's start by collectively working towards a shared concept of night mode and open things up once we've crossed that bridge.
A full fledged theme editor! DEV brings back Myspace 🤣
Is the dark theme somewhere on github, so I can edit it?
Oh, found it
github.com/thepracticaldev/dev.to/...