jerosoler / Drawflow

Simple flow library 🖥️🖱️
https://jerosoler.github.io/Drawflow/
MIT License
4.78k stars 741 forks source link

Enabling dark mode #69

Closed anish97IND closed 3 years ago

anish97IND commented 3 years ago

Hi, Is there way where we can toggle between dark mode and light mode to make things more user friendly.

jerosoler commented 3 years ago

Hello @anish97IND

Use the css custom variables for create dark mode theme.

:root {
  --dfNodeBackgroundColor: #000000;
}
:root.dark-mode { 
 --dfNodeBackgroundColor: #FFFFFF;
}

.drawflow .drawflow-node {
  background: var(--dfNodeBackgroundColor);
}

You can use the theme generator that exports the code with custom variables https://jerosoler.github.io/drawflow-theme-generator/

View tutorial dark mode with css variables: https://dev.to/ananyaneogi/create-a-dark-light-mode-switch-with-css-variables-34l8

I hope it helps you.

anish97IND commented 3 years ago

Hi @jerosoler , Thanks for replying. I guess this will cater to my requirements very well. Thank you

pkasson commented 2 years ago

Awesome - thank you !