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

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.

Example

 

HTML Content

HTML
<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

CSS
#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;
}

Description  

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.

Browser Compatibility  

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support Not supported 3.0 (1.9)[1] Not supported Not supported Not supported
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support Not supported ? Not supported Not supported Not supported

[1] Implemented in bug 426660. Changed the behavior of Royale and Zone to work the same as Luna in bug 429176.

Specifications  

Not part of any specification.

License

© 2016 Mozilla Contributors
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-us/docs/web/css/:-moz-system-metric(windows-default-theme)

CSS CSS Pseudo-class CSS Reference NeedsMobileBrowserCompatibility Non-standard