Open Bug 1060941 Opened 10 years ago Updated 2 years ago

Add a way for themes to detect the OS (e.g. via media query)

Categories

(Core :: CSS Parsing and Computation, defect)

defect

Tracking

()

People

(Reporter: kairo, Unassigned)

Details

To be able to esp. make a theme adjust for differences on Mac vs. Linux and Windows, it needs to be able to have some OS-specific (Mac-specific in my case) rules. We have a number of media queries for some Mac and Windows themes, we even have one for Windows OS versions (see bug 810399), we should have something for detecting the OS - at least between the major ones.

FWIW, interestingly, right now, via the various values of -moz-os-version, one could detect Windows suitably well right now, and with the various -mac-mac-*-theme ones, Mac OS 10.7+ or even 10.6 with Graphite theme can be covered, but not "all Mac" (or "all linux/gtk2" if someone would need it).
Gor now I'm using those ugly things:

@media (-moz-mac-graphite-theme), (-moz-mac-lion-theme), (-moz-mac-yosemite-theme) { /* mac stuff here (will not cover 10.6 without graphite) */ }
@media (-moz-mac-graphite-theme: 0) and (-moz-mac-lion-theme: 0) and (-moz-mac-yosemite-theme: 0) { /* non-mac stuff here (will include non-graphite 10.6) */ }

Though reading the code, the -yosemite- stuff is probably redundant as -lion- checks for "10.7 or higher".
We should also implement -moz-os-version for all OSs for consistency. Then we can stop adding new -moz-mac-…-theme ones.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.