We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS

:-moz-system-metric(windows-default-theme)

Non-standard
This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

The :-moz-system-metric(windows-default-theme) CSS pseudo-class matches an element if the user is currently using one of the following themes in Windows: Luna, Royale, Zune, or Aero (i.e., Vista Basic, Vista Standard, or Aero Glass). This will exclude Windows Classic themes as well as third-party themes.

This selector is intended for use mainly by theme developers.

Note: Since Firefox 58, this pseudo-class is no longer available to web content — it is only available internally (e.g. to XUL / chrome code). See bug 1396066 for more details.

Example

HTML Content

<p id="defaultThemes">
  This paragraph should have a green background with Luna/Royale/Zune/Aero
  Windows themes and red with other themes.
</p>

<p id="nonDefaultThemes">
  This paragraph should have a green background with Windows Classic or
  third-party themes and red with other themes.
</p>

<p id="notSupported">Theme detection is not supported.</p>

CSS Content

#defaultThemes,
#nonDefaultThemes {
  background-color: #FFA0A0;
}

#defaultThemes:-moz-system-metric(windows-default-theme) {
  background-color: #A0FFA0;
}

#nonDefaultThemes:not(-moz-system-metric(windows-default-theme)) {
  background-color: #A0FFA0;
}

#notSupported:-moz-system-metric(windows-default-theme),
#notSupported:not(:-moz-system-metric(windows-default-theme)) {
  display: none;
}

Specifications

Not part of any specification.

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support No No3 — 581 No No No
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support No No No4 — 581 No No No

1. Internal only since Firefox 58 (See bug 1396066).

Document Tags and Contributors

Last updated by: ExE-Boss,