Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dark theme #206

Closed
ArLEquiN64 opened this issue Sep 8, 2017 · 13 comments
Closed

Dark theme #206

ArLEquiN64 opened this issue Sep 8, 2017 · 13 comments
Assignees
Milestone

Comments

@ArLEquiN64
Copy link
Contributor

I want dark theme like white character and black background.
and if you don't mind, could you support any syntax theme?

@hackjutsu
Copy link
Owner

hackjutsu commented Sep 8, 2017

@ArLEquiN64
What kind of dark theme are you referring to ?

  • app
  • editor
  • syntax highlight

--- Update ---
To be honest, it's difficult and sometimes frustrating to pick up a dark palette that make everything looks cool.

If you have some idea, feel free to post a screenshot of your mockup, or you can try to apply a global style sheet to see how it works out.

@hackjutsu
Copy link
Owner

hackjutsu commented Aug 28, 2018

Does someone know how to load CSS dynamically in webpack, like loading different stylesheet based on config variable? Just tried on this issue but get stuck.

Currently, Lepton loads stylesheet like this https://github.com/hackjutsu/Lepton/blob/master/app/containers/userPanel/index.js#L10

@DNLHC
Copy link
Collaborator

DNLHC commented Aug 29, 2018

@hackjutsu you could use dynamic import

if (darkTheme) {
    import('./dark-theme.scss')
} else {
    import('./light-theme.scss')
}

but, i think the best way for theming would probably be CSS-variables, you can easily manage it with JS.

@hackjutsu
Copy link
Owner

hackjutsu commented Aug 31, 2018

Thanks @DNLHC

I created a feature branch https://github.com/hackjutsu/Lepton/tree/feature/dark-theme, but run into the following error

ERROR in ./app/containers/loginPage/index.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: 'import' and 'export' may only appear at the top level (12:2)

  10 | const darkTheme = true
  11 | if (darkTheme) {
> 12 |   import './index.scss'
     |   ^
  13 | } else {
  14 |   import './index.dark.scss'
  15 | }

Feel free to play with the code in this branch:)

@DNLHC
Copy link
Collaborator

DNLHC commented Aug 31, 2018

@hackjutsu Yeah, the dynamic import has slightly different syntax to the static one, it should be called with parenthesis.

@vielhuber
Copy link

Some update on this?

@vviikk
Copy link
Contributor

vviikk commented Nov 29, 2018

This looks like a good project I can work on this week. I'll keep you guys posted.

@hackjutsu
Copy link
Owner

@vviikk Feel free to take a look at the feature/dark-theme branch.

@vviikk
Copy link
Contributor

vviikk commented Dec 4, 2018

Hi, @hackjutsu. Could we communicate on Spectrum? I've created a room there. Currently, I'm updating outdated dependencies as I had a bit of trouble getting it to work locally (in Linux & WSL). IIRC, last month I was also having build issues on the Mac. Once I get to build with the latest toolchain (Babel / Webpack), I'll make a PR.

Would like to pick your brain about styled-components & it's theme layer and slowly moving out of Bootstrap.

Join the community on Spectrum

@hackjutsu
Copy link
Owner

hackjutsu commented Dec 4, 2018

@vviikk Thanks for creating the chat room. Feel free to leave your questions there, and I'll come back to them within this week. (Sorry, a little bit busy at work for this quarter)

@Jamdx
Copy link

Jamdx commented Apr 23, 2019

When this feature will be part of it? dark mode!!

@hackjutsu
Copy link
Owner

hackjutsu commented Apr 29, 2019

Screen Shot 2019-04-28 at 9 14 32 PM

Working on an early version of dark mode in feature/dark-theme branch. It takes some time to adapt the colors here and there. Stay tuned.

@vielhuber
Copy link

Wow, awesome!

@hackjutsu hackjutsu self-assigned this Apr 30, 2019
@hackjutsu hackjutsu added the theme label May 4, 2019
@hackjutsu hackjutsu modified the milestones: 1.7.x, 1.8.0 May 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants