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

Re: [css-document-class] defining basic style

From: Sanja Bonic <sanja.bonic@univie.ac.at>
Date: Thu, 05 Feb 2015 12:38:37 +0100
Message-ID: <54D3563D.3090801@univie.ac.at>
To: www-style@w3.org
>> >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>
> That's basically something like
>    @import url("book") screen;
>    @import url("minimal") print;
>    @import url("slides") projection;

Yes and no - importing still needs the boilerplate code that we could 
avoid if the browser renders the basic style without having to import 

> There have been and are many efforts to create re-usable style sheets,
> an early one is<http://www.w3.org/StyleSheets/Core/>, similarily some
> browsers come with pre-defined style sheets, e.g. Opera "Classic" lets
> users choose specialised style sheets for high contrast and similar
> things. There are probably mountains of "WordPress themes".

WordPress is not what I was aiming at. And one browser having its own 
specialised stylesheets is good, but it's not a standard and it doesn't 
help the user when they would like to apply a certain style without 
relying on a CMS or the usage of one browser.

I was thinking of a standardized set of guidelines for browsers so that 
a document looks like a basic set of styles and the browsers themselves 
would implement this. So, a normal user does not have to think of 
cross-browser compatibility when they just want to write an article and 
maybe print them later on in a different format. For these purposes, 
usually LaTeX is used together with a basic document class, but only 
people who already have some more advanced IT knowledge use LaTeX and 
the others are stuck with Word and its alternatives.

The core stylesheets you linked are a really early approach, as you 
said, and would need some editing to adapt them to HTML 5. Also, I was 
thinking of something much simpler where the user doesn't have to think 
and learn so much. Why not File -> New Document in every browser that 
lets you create a standard document and then apply a style to it? Could 
be more of WYSIWYG where you just have textboxes that automatically get 
converted to h1, article, and other "correct" tags that are then styled 
by the browser using our style guidelines. The user can then save the 
HTML that was created and add css as and if needed.

This was just an implementation example. For the mailing list, my 
suggestion is:

1. make available a tag for document class in HTML, similar to LaTeX
2. have a set of style guideline standards including recommended HTML 
tags, so that the browser devs know how to implement them - ensuring 
that a certain style always looks the same, without the user having to 
use third-party libraries or learn CSS just to make a two-column article
3. for backwards compatibility, {all: minimal} is the default and does 
not need to be specified - it is the basic styling of an HTML page as we 
know it now

All the best,
Received on Thursday, 5 February 2015 11:39:04 UTC

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