an arrangement for generating page and / or device - optimized cascading style sheets is disclosed in which css blocks are provided in a collection of one or more files . in an illustrative example , the collection of files is arranged as xml files . each css block is marked with attributes that indicate to which modules used to compose a page it applies , and / or its applicability to a specific device . at page rendering time , the css for the page is dynamically generated by selecting css blocks from the files based on detected device capabilities and / or the modules on the page .