W3C home > Mailing lists > Public > www-style@w3.org > August 2000

Proposal Feature: Macro Definitions

From: Luis Ferro <luis.ferro@mail.kpnqwest.pt>
Date: Tue, 22 Aug 2000 12:14:38 +0100
Message-ID: <39A2609E.BB38EB63@mail.kpnqwest.pt>
To: www-style <www-style@w3.org>
Hi there,

Macro Definitions

They work as containers for property values and/or properties and values
but the two can't be mixed in the same token. They allow a central
reference system for deep inside properties inside a CSS.

Usability

Allows seamingless integration with real-world software by providing
ways to centrally store the definitions, allowing for a "paletized" way
to handle all properties and allowing the existence of "snippets" of CSS
as groups of properties (that can be or not be cascaded, depending of
the implementation).

Examples

%MyTextFont {
    value: "Trebuchet MS", Tahoma, Verdana, Arial, Geneva, Helvetica,
sans-serif;
}

%standard_font_for_text {
 font-family : %MyTextFont;
 letter-spacing : 1pt;
 color : #000080;
}

%standard_font_for_others {
 font-family : times new roman;
 letter-spacing : 1pt;
 color : #000080;
}


body {
%standard_font_for_text;
}

h1, h2 {
    background-color: red;
}

h3 {
    background-color: blue;
}

th {
%standard_font_for_others
}

.MyClass {
%standard_font_for_text;

}

.MyOtherClass {
%standard_font_for_others
}

And so one... in this way, styles that don't inherit the definitions by
way of css (and that happens a lot - both by need or to circunvent bugs
in implementations) could still be linked by way of macro definitions.
The definitions would become also much less verbose and would always be
possible to "compress/decompress" a css definition with them, turning
the css much smaller. Of course one could say that if one uses CSS
smartly with regard with the cascading properties one archieves the
same, but the problem with it is that level of "guru" level isn't for
the real people who have to use CSS to format a document and has to do
it NOW.

Also this in part replaces my proposal of paletization of colors inside
documents because one can archive the same purpose with this (apart from
archive the same with any properties not only colors). Still the
definition of opposit colors and inverse colors isn't overriden.

Cheers,
Luis Ferro
WebDev
Received on Tuesday, 22 August 2000 07:14:52 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:05 GMT