You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have recently started to use papercss and I would like to have a dark-mode in my project so I thought that's a nice issue to tackle.
I have a couple of questions/assumptions that I would like to get clarity on.
1- Do we want to generate paper-dark-min.css and let the user load different builds using @media (prefers-color-scheme: dark)
2- If not, then I assume we would rely on css variables to dynamically change the variables, then how do we approach IE? would something like this be sufficient?
Hey @seifsay3d sorry for the delay! You bring up a good point about IE (the problem child). Going against my own comment above, I think a solution without using media queries might be the best way to tackle this for now.
I really like your idea of having a simple .dark class that could be put on the <html> tag. That way we can leave it up to the user of PaperCSS if they want a dark theme or not. It's easy to make it dynamic for the user's preferences using a few lines of JavaScript. Plus once IE browser support is there, it'll be easy to move this over to using css variables.
So a modified version of your plan would look like:
Create dark mode variable list with appropriate defaults
Add sass variables as css variables to html element based on html.dark
Update color references to use some new color mixin (to get light vs dark colors)
Activity
[-][Feat] Drak(Night) Mode[/-][+][Feat] Dark mode[/+]rhyneav commentedon Aug 18, 2019
As a dark mode user, this would be awesome. Here's a good primer on how this could be introduced. It looks like just a simple media query:
seifsay3d-zz commentedon Apr 21, 2020
I have recently started to use papercss and I would like to have a dark-mode in my project so I thought that's a nice issue to tackle.
I have a couple of questions/assumptions that I would like to get clarity on.
1- Do we want to generate paper-dark-min.css and let the user load different builds using
@media (prefers-color-scheme: dark)2- If not, then I assume we would rely on css variables to dynamically change the variables, then how do we approach IE? would something like this be sufficient?
Currently, I'm thinking of a solution that would be something along these lines
1- create dark mode variable list with appropriate defaults
2- Add sass variables as css variables to html element based on
@media (prefers-color-scheme: dark)orhtml.dark{}3- update all usages for scss vars to css variables with IE fallback
rhyneav commentedon May 17, 2020
Hey @seifsay3d sorry for the delay! You bring up a good point about IE (the problem child). Going against my own comment above, I think a solution without using media queries might be the best way to tackle this for now.
I really like your idea of having a simple
.darkclass that could be put on the<html>tag. That way we can leave it up to the user of PaperCSS if they want a dark theme or not. It's easy to make it dynamic for the user's preferences using a few lines of JavaScript. Plus once IE browser support is there, it'll be easy to move this over to using css variables.So a modified version of your plan would look like:
html.darkWhat are your thoughts on that?
seifsay3d-zz commentedon May 18, 2020
Sounds awesome, I'll give it a shot then 🕺
rhyneav commentedon May 18, 2020
That sounds great, thank you for taking it on! Let me know if I can help you in any way!
rhyneav commentedon Sep 13, 2020
Just released in
v1.8.0!