主权项 |
1. A computer-implemented method of customizing a cascading style sheet for a requesting device, the method comprising:
receiving at a server a first request for content from a browser of a requesting device, wherein the requesting device does not support or is not configured to execute at least one media query property; receiving at the server a user agent from the requesting device, the user agent comprising text identifying the browser type; serving the first requested content and device cookie generation code to the requesting device, wherein the device cookie generation code is configured to be executed by the browser of the requesting device to obtain properties of the requesting device from the requesting device, including at least a display size in terms of pixels, and to store the obtained properties locally as a device cookie on the requesting device, the properties including at least one device property not available from the requesting device via a media query or a user agent; receiving at the server the device cookie from the requesting device; accessing by the server a device description database, the device description database comprising device properties for a plurality of browser-equipped devices; utilizing information from the user agent from the requesting device to locate corresponding device properties from the device description database; compiling, by the server using a server side media query compiler, a cascading style sheet based at least in part on properties stored in the device cookie, including at least the display size, and the located corresponding device properties from the device description database, wherein the compiler is configured to exclude, based on the properties stored in the device cookie and the located corresponding device properties, one or more browser CSS properties that are not supported or that will not be executed by the browser of the requesting device; and serving by the first system the cascading style sheet to the requesting device. |