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 mode #56

Closed
jimmywarting opened this issue May 29, 2023 · 3 comments
Closed

dark mode #56

jimmywarting opened this issue May 29, 2023 · 3 comments

Comments

@jimmywarting
Copy link

Could you add a dark theme to https://www.w3.org/TR/battery-status?
it's currently very bright

@anssiko
Copy link
Member

anssiko commented May 29, 2023

@jimmywarting thanks for raising this issue. This spec is authored with ReSpec.js and that tool is currently lacking dark mode support. You can voice your support for this feature in https://github.com/w3c/respec/issues/2651 (or even submit a PR to implement this feature in that tool). Some specs are authored with another tool, Bikeshed, that does have dark mode support, so you may see some other specs go dark.

Once implemented this spec will automatically "go dark" (no pun intended), so I'm closing this issue with an expectation you'll track the feature development through the mentioned issue.

While you're here, please feel free to check out https://github.com/w3c/battery/blob/gh-pages/energy-saver-mode-explainer.md that was initiated based on your proposal and submit any feedback via #9. We appreciate your continued contributions in this space.

@anssiko anssiko closed this as completed May 29, 2023
@jimmywarting
Copy link
Author

Looks grate!

some nit pick, while reading this code example:

let b = await navigator.getBattery();

if (b.energySaverMode) {
    saveEnergy();
}

b.energysavermodechange = () => {
    if (this.energySaverMode) saveEnergy();
}

I could not help but thinking: Hmm is energySaverMode a string or not? feels like energySaverMode could be either a "on" or "off" and not a boolean

I don't know how i feel about the r in saver at the end... just using save is good enough.

I like android / MacOS / iOS naming convention better.

  • isPowerSaveMode
  • lowPowerModeEnabled

It's a clear indication that it's a boolean. an alternative name could be energySaveModeOn or shouldPreserveEnergy
or how about using b.prefersEnergySaving in javascript as well? i would kind of like it if js & css had similar naming convention. i think i might like prefersEnergySaving the most.

also this code example:

- b.energysavermodechange = () => {
+ battery.onenergysavermodechange = () => {
    if (this.energySaverMode) saveEnergy();
}

@anssiko
Copy link
Member

anssiko commented May 29, 2023

Thanks for this great feedback, but please move it to #9 so it is in the right place 😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants