-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Applies a dark theme, based on a global class #243
Conversation
Cool! Just make sure it's synced with the devtools colour |
Yup I used all of the same background and border colors that the dark theme already uses. |
I meant that the theme should be dark only when the devtools are in dark mode too. But you're right to do so, thanks for pointing that out 👍 |
@posva Right, which is why this is marked as a [WIP]. I mentioned in the description that I needed some help finishing that part up. I don't know anything really about extension development. It seems that we can determine which theme devtools is currently using through the I'll dig into it a little more, but in the meantime if anyone has a recommendation on the best way to implement the switch from light to dark, let me know. I just don't have a lot of bandwidth at the moment. |
Thanks a lot for looking into this. |
Sweet. I was just about to start working on this. Looks good. |
Sorry for the delay, testing now. I'll let you know 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
ping @yyx990803 |
Nice work - as @crswll mentioned, I think we should give the text in the state inspection panel more contrast (especially the purple and the gray base text). |
Yeah, emulating the color scheme of the native devtool would be great. |
I'll get this updated in the next day or so as soon as I get back from vacation |
Looks good! |
Very nice looking! |
src/devtools/App.vue
Outdated
@@ -60,7 +60,8 @@ export default { | |||
computed: mapState({ | |||
message: state => state.message, | |||
tab: state => state.tab, | |||
newEventCount: state => state.events.newEventCount | |||
newEventCount: state => state.events.newEventCount, | |||
isDark: () => chrome.devtools && chrome.devtools.panels.themeName === 'dark' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few small things:
-
The devtools code itself doesn't assume it's always running in Chrome. We need to check
typeof chrome !== 'undefined'
first. -
isDark
doesn't really need to be a computed property. It's initialized only once and shouldn't be inmapState
either. Let's move it todata()
instead.
Should be good to merge after fixing these. Great work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hows that look?
Thank you @jhoff , great work! 👍 |
Hello, I just found out a way to integrate vue-devtools into an NW.js dev project. This makes it awesome to have a Vue dev env targeted for nw! What I found though, is that the dark theme is not being applied to the NW dev tools once I change the theme. I noticed that it has a different menu for changing themes on the settings pane. Chrome (60.0.3112.113 (Official Build) (64-bit) ): I think something on this check isn't being matched in the case of the I forced it to be I acknowledge I don't know enough about NW.js yet nor much about how closely it is a "Chrome" window. Much less about creating extensions! Also know that it is a bit of a stretch to ask for a fix on such a thing, I just thought it would be worth sharing my findings. Cheers! |
@ackzell If anyone finds out how to fix it, we'll welcome a PR 👍 |
I need a little help here, but I did most of the the leg work from a styling perspective.According to https://bugs.chromium.org/p/chromium/issues/detail?id=608869, there should now be possible to get the value of the chrome devtool theme viachrome.devtools.panels.themeName
.I'm not familiar enough with chrome devtool development to know how to do it correctly, so hopefully this is an easy one for someone that knows what they're doing.Implementation of the dark theme is done by adding adark
class to the root#app
element. See change to line 4 atsrc/devtools/App.vue
.Edit: When installed in chrome devtools, now detects the theme automatically. Note: the dark theme doesn't work when running
npm run dev
. You will have to add thedark
class manually to test that I guess.Also, any feedback would be appreciated.