W3C home > Mailing lists > Public > www-style@w3.org > February 2015

[css-document-class] defining basic style

From: Sanja Bonic <sanja.bonic@univie.ac.at>
Date: Thu, 05 Feb 2015 00:15:30 +0100
Message-ID: <54D2A812.9060004@univie.ac.at>
To: "www-style@w3.org" <www-style@w3.org>
Hi,

in LaTeX we have \documentclass{<classname>} to define the text's basic 
look. Has there ever been any interest in or discussion about defining a 
basic set of style names (like article, minimal, report, thesis, book, 
slides, etc)?

I'm thinking of something like this to be included in the HTML head:

<style>
document-style {screen: book, paper: minimal, slides: presentation}
</style>

This example means that for the screen, make the site look like a book; 
for paper make it minimal style and just print my text; for full-screen 
browser view make my <article> tags (or whatever we recommend) be 
slides. @media queries could override this setting or cascade on top of it.

Any further elements wouldn't need to be defined (for minimalists) 
because the browser takes over the general style and you only change the 
elements you want to be changed. This saves a lot of boilerplate 
stylesheet code. Of course we'd need to recommend a few HTML elements to 
go along with these style guidelines. Those would be meaningful elements 
such as <article>, <aside>, <section>, <h1> ...

If nothing is specified, the document-style {all: minimal} is applied 
which is basically the status quo. For everything else, we define style 
guidelines that are implemented by the browser and the user can just 
change specific elements.

Cheers,
Sanja
Received on Thursday, 5 February 2015 09:14:40 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:52:01 UTC