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
Previously, `batteryCritical` overwrote `batteryLow`, whereas, really,
it’s supposed to be a subset. This means we now get both properties set
to `true` and both classes added to the `<html>` once battery level is
≤5%. The upshot of which is that your customisations can be much more
succinct; anything you apply to low battery users will automatically
also carry over to critical, and you don’t need to do anything twice.
|`.has-battery-charging`| On charge |`battery.charging === true`|
155
155
|`.has-latency-low`| Low RTT |`rtt < 75ms`|
156
156
|`.has-latency-medium`| Medium RTT |`75–275ms`|
@@ -172,14 +172,14 @@ Obs.js also stores the following properties on the `window.obs` object:
172
172
|`config.observeChanges`| boolean | Whether Obs.js attaches change listeners |**Default `false`**; set by you _before_ Obs.js runs | Opt-in for SPAs or long-lived pages |
173
173
|`dataSaver`| boolean | User enabled Data Saver |`navigator.connection.saveData`| — |
174
174
|`rttBucket`| number (ms) | RTT bucketed to **ceil** 25 ms (e.g. 101→125) |`navigator.connection.rtt`| Undefined if Connection API missing |
|`deliveryMode`|`'rich' \| 'cautious' \| 'lite'`| How “heavy” you should go | Derived from capability and conservation | Rich if **strong** and **not** conserving; Lite if **weak** or **conserve**; else Cautious |
181
181
|`canShowRichMedia`| boolean | Convenience: `deliveryMode === 'rich'`| Derived from `deliveryMode`| Shorthand for “go big” |
182
182
|`shouldAvoidRichMedia`| boolean | Convenience: `deliveryMode === 'lite'`| Derived from `deliveryMode`| Shorthand for “be frugal” |
183
-
|`batteryCritical`| boolean \| null | Battery `≤ 5%`| Battery API |Mutually exclusive with `batteryLow`; `null` if unknown |
184
-
|`batteryLow`| boolean \| null |`5% < level ≤ 20%`| Battery API |`true`only when not `batteryCritical`|
183
+
|`batteryLow`| boolean \| null | Battery ≤20%| Battery API |`true` when battery level is ≤20%; `null` if unknown|
184
+
|`batteryCritical`| boolean \| null |Battery ≤5% | Battery API |`true` when battery level is ≤5%; `true` in addition to `batteryLow`|
185
185
|`batteryCharging`| boolean \| null | On charge | Battery API |`null` if unknown |
0 commit comments