phpgroupware-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SV: [Phpgroupware-developers] some strange beahviour with later upda


From: Dave Hall
Subject: Re: SV: [Phpgroupware-developers] some strange beahviour with later updates of head
Date: Mon, 10 Apr 2006 22:41:42 +1000

Hi Alan,

On Mon, 2006-04-10 at 08:20 -0400, Alan Langford wrote:
> When I first started pushing all my formatting into style sheets, I
> would up with far too many styles, one for each variation (like
> product, product_left, product_center, product_bold,
> product_left_bold... and on). Then it dawned on me that the class
> attribute refers to a list of styles, so you can make a composite
> class. The tendency is then to have something like <td class="product
> bold left">... which works, but really is about as bad as encoding
> everything in a style. The form I now prefer is a list of "formatting
> concepts", so I get <td class="product column_head">, leaving
> "product" to select cell styles and "column_head" to handle
> right-justification and bold.
> 
Multiple classes can be good to use.  I primarily use that for dynamic
styling such as selecting the currently select "tab" or something
similar.

I prefer to use the cascade more.  So I would have something like:

<style>
        thead td
        {
                font-weight: bold;
        }

        #products thead td
        {
                text-align: center;
        }

        td.price
        {
                font-weight: bold;
        }

        tr.clearance td.price
        {
                color: #f00;
        }
</style>

<table id="products">
        <thead>
                <tr>
                        <td>ID</td>
                        <td>Name</td>
                        <td>Price</td>
                </tr>
        </thead>
        <tbody>
                <tr>
                        <td>1</td>
                        <td>Thingymibobs</td>
                        <td class="price">$10.00</td>
                </tr>
                <tr class="clearance">
                        <td>2</td>
                        <td>Wotchimicallitz</td>
                        <td class="price">$9.99</td>
                </tr>
                <tr>
                        <td>3</td>
                        <td>Sumthing</td>
                        <td class="price">$14.95</td>
                </tr>
        </tbody>

So we end up with the price being red for the clearance items and the
classes and ids are descriptive of their role rather than the
presentation they create.  So then someone else using the same markup
can make it appear very different.

> Maximum flexibility with minimal styles.
> 
> Also on the subject of browser independence, you might find the
> following JS class useful. Feel free to integrate it with your code
> (with or without credit).
> 
> 
> // Web Browser Independence Library
> //
> // Author: Alan Langford
> //
> // This file creates a class that provides browser capability flags
> // and a browser-independent interface to common functions.
> //

Cool.  It looks a bit similar to
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/js/core/base.js?rev=1.1&root=phpgwapi&view=markup

I would welcome any input you have regarding the development of HEAD

Cheers

Dave
-- 
Dave Hall (aka skwashd)
API Coordinator
phpGroupWare
+-------------------------------------+-------------------------------+
| e address@hidden          | w phpgroupware.org            |
| j address@hidden                 | aim skwashd                   |
| icq 278064022                       | msn address@hidden       |
| sip address@hidden       | y! skwashd                    |
+-------------------------------------+-------------------------------+





reply via email to

[Prev in Thread] Current Thread [Next in Thread]