W3C home > Mailing lists > Public > www-style@w3.org > December 2005

suggestion: common CSS prefix

From: Benjamin Piwowarski <Benjamin.Piwowarski@laposte.net>
Date: Sun, 11 Dec 2005 12:09:15 +0000
Message-ID: <439B19C9.2040508@laposte.net>
To: www-style@w3.org

Dear all,

I would like to submit a suggestion regarding the CSS inclusion that 
would be helpful when including third-party extensions within a web 
site, or external XML files within an XML file, etc. I searched the 
archives and did not find another similar proposition so I think this is 
not a duplicate.

The idea is to provide a common prefix for the whole CSS selectors; 
let's take an example:

Let "external.css" be a file with

div { ... }
img { ... }

When including the css stylesheet within an already existing web site, 
we would like to apply the CSS definitions only within a subpart of the 
X(HT)ML file: for example by creating a "<div id='external'>" enclosing 
tag. With the current CSS mechanism, if we don't want the new 
definitions to interfere with the main CSS file(s), we have to rewrite 
every conflicting definition with:

div#external div { ... }
div#external img { ... }

The idea would be to be able to specify a common prefix, thus only 
writing it once: for example, that could be done that way:

@prefix div#external;

div { ... }
img { ... }

Received on Sunday, 11 December 2005 14:18:57 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:22 UTC