Ok, this is weird... the original discussion on the general TG list
has disappeared! I can't find it on google groups.

Anyway in case it's lost, here is a paste from my gmail (sorry it's
missing headers, I could dig them up if anyone cares):

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

targeting of widget labels with CSS - patch coming soon   TG
                
isaac   
to turbogears
 Sep 9

Hi all,

I was just working on some ListForm widgets and noticed that there's
not a good way to target the label tags with specific CSS (well,
there are surely ways in CSS using advanced selectors, but those are
not quite reliable in the browsers yet).

Anyway, I'm looking to (1) target the label of a required field (to
make it bold, for example), and also (2) to be able to style the
label for a checkbox differently than a text field, for example.

I started working on a patch to widgets/forms.py and was able to add
e.g. class="required for_checkbox" to the labels of a ListForm and
TableForm and it worked. But then I forgot I'd done it and wiped it
out while installing 1.0b1...  d'oh! Anyway, it wasn't much work so I
can do it over easily, but I'm just curious if anyone else is
interested in this? Any thoughts on what to name the classes it adds?

I'd really like to see this make it into 1.0 final, or 1.1. This
seems important for TG playing well with Web Standards (unless I'm
missing something really obvious).

--isaac



Kevin Dangoor   
to turbogears
Sep 12

On Sep 9, 2006, at 7:41 PM, isaac wrote:

> I was just working on some ListForm widgets and noticed that there's
> not a good way to target the label tags with specific CSS (well,
> there are surely ways in CSS using advanced selectors, but those are
> not quite reliable in the browsers yet).
>
> Anyway, I'm looking to (1) target the label of a required field (to
> make it bold, for example), and also (2) to be able to style the
> label for a checkbox differently than a text field, for example.
>
> I started working on a patch to widgets/forms.py and was able to add
> e.g. class="required for_checkbox" to the labels of a ListForm and
> TableForm and it worked. But then I forgot I'd done it and wiped it
> out while installing 1.0b1...  d'oh! Anyway, it wasn't much work so I
> can do it over easily, but I'm just curious if anyone else is
> interested in this? Any thoughts on what to name the classes it adds?

Are you sure there are no classes already devised for required? (I
can't look it up at the moment).

Also, when putting together a patch, you really want to work from the
svn copy (and you can do setup.py develop to ensure that your code
isn't overwritten by installing a new release).

Thanks for looking into this!

Kevin


isaac   
to turbogears
Sep 12
On 9/12/06, Kevin Dangoor <[EMAIL PROTECTED]> wrote:
>
> Are you sure there are no classes already devised for required? (I
> can't look it up at the moment).

The class 'required' is currently added to the form control itself,
but not its label (or the table row/list item). Hmm, it might actually
be simplest to apply it to the <li> or <tr> because then you could do
CSS like this:

.required label { font-weight: bold }
.required input { border: 1px solid red }
.for_checkbox label { font-size: 0.9em }

etc... which would also yield cleaner html than adding it to the label
_and_ the form control itself.

> Also, when putting together a patch, you really want to work from the
> svn copy (and you can do setup.py develop to ensure that your code
> isn't overwritten by installing a new release).

will do.

> Thanks for looking into this!

no prob... needed it for a project anyway.

--i

Reply   Forward
        
                
                
isaac   
to turbogears
Sep 17

Hi,

A patch for this is posted, #1116:
http://trac.turbogears.org/turbogears/ticket/1116

it's against the trunk as it was 10 minutes ago.

HTH!

--isaac

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Trunk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears-trunk
-~----------~----~----~----~------~----~------~--~---

Reply via email to