W3C home > Mailing lists > Public > www-style@w3.org > October 2006

[CSSX] Named style sets. Scrollbar styling, etc.

From: Andrew Fedoniouk <news@terrainformatica.com>
Date: Sat, 7 Oct 2006 15:38:00 -0700
Message-ID: <000501c6ea61$3e663210$3401a8c0@TERRA>
To: <www-style@w3.org>

First of all, this is not a proposal but just thoughts aloud or
request for discussion if you wish.

Problem in general:
In some cases there is a need of assigning blocks of styles as whole sets -
"all or nothing".

Example - styling of scrollbars:
(I am not speaking here about aesthetical, usability and other matters
of scrollbars styling - assume that these issues are irrelevant to the 
problem)

Let's assume that scrollbar consists of DOM elements and
each of them can be styled independently.
Imagine that scrollbar has following structure:

<scrollbar>
  <button class="step-minus" />
  <button class="slider" />
  <button class="step-plus" />
</scrollbar>

Let's imagine that we have a task to assign non-stnadard scrollbar
style to some scrollable element with id #some-container.

To be able to accomplish this task
I introduced something what I name "style sets".

Definition by example:

/* some scrollbale container with custom scrollbars */
#some-container
{
   overflow: auto;
   /* non standard attributes, sic: */
    vertical-scrollbar: my-v-scrollbar-style; /*nmtoken - name of style 
set*/
    horizontal-scrollbar: my-h-scrollbar-style;
}

and sowewhere in style system I have following defintion:

/* declaration of named style set */
@set my-v-scrollbar-style
{
    .step-minus
    {
        background-color: ....;
        border: ....;
    }
    .step-plus
    {
        background-color: ....;
        border: ....;
    }
}
---------------------------

So if  vertical-scrollbar: set-name;  is defined
for some element and there is such named set seen
somewhere then it will be applied in the whole to
correspondent scrollbar.

I found this approach ("all or none") "ideologically
better" than what is implemented in Internet Explorer [1].

Another benefit of style sets: style sets do not "pollute"
main namespace of style systems -
are not making worse task of style resolution of
styles for the whole document/DOM.

---------------------------

I beleive that there are cases other than scrollbar
styling where style sets ("all or none") are also highly
desirable. (Task of input elements styling is in
this category for sure.)

So is the question: are these named sets useful
as a generic feature of CSS?

Currently CSS has at least one use case for
style sets - @media blocks. Probably it makes
sense to generalize this somehow and combine
them in single entitty?

Andrew Fedoniouk.
http://terrainformatica.com


[1] http://codepunk.hardwar.org.uk/bcss06.htm
Received on Saturday, 7 October 2006 22:38:16 GMT

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