Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-11-24 22:41:12

minimal design
Member
Registered: 2006-10-15
Posts: 38

Too many default css classe/id

I’m formatting my site right now and I keep on having to specify empty class attributes in txp tags and/or having to write some not so great CSS rules to work around the default which can be pretty frustrating.

For example: why have <txp:comments_invite> insert the class on both the wrapper and the anchor? Whichever way you look at it, that’s just bad CSS

I love Txp but I think it needs a CSS/HTML refresh. I must sound like a whining bastard, but I’d be willing to help if that’s something the devs are interested in…

Offline

#2 2006-11-24 23:10:06

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: Too many default css classe/id

Largely because of backwards compatibility. We can’t remove classes from elements without breaking thousands of sites.

I love Txp but I think it needs a CSS/HTML refresh. I must sound like a whining bastard, but I’d be willing to help if that’s something the devs are interested in…

We always welcome patches.


Alex

Offline

#3 2006-11-25 02:55:56

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Too many default css classe/id

Another point of interest:

…why have <txp:comments_invite> insert the class on both the wrapper and the anchor? Whichever way you look at it, that’s just bad CSS

Not necessarily.

But, as Alex has pointed out, whenever you see something “redundant” in Textpattern, 9/10 it is because we have to deal with not breaking things for long-time users.

Offline

#4 2006-11-25 06:10:35

minimal design
Member
Registered: 2006-10-15
Posts: 38

Re: Too many default css classe/id

OK, I understand the backward compatibility issue – makes sense.

As far as the “Not necessarily,” if you mean that you can get around that redundancy, you’re right, and I found the solution in another post, I didn’t come up with it but I read so many posts today I can’t remember who I should credit for it. This will give you the same as <txp:comments_invite> but without the bloated CSS and you get to pick what’s around the comment number too (of course you can change the class to whatever you want):

<p class="post_comments"><a href="<txp:permlink />#comment"> <txp:comments_invite textonly="1" showcount="0" /></a> (<txp:if_comments><txp:comments_count /><txp:else />0</txp:if_comments>)</p>

But if you meant that having the same class applied to an element and its child is not necessarily bad CSS, I’ll have to respectfully disagree :)

Offline

#5 2006-11-25 08:15:56

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Too many default css classe/id

If you are using semantic class names, it can be perfectly legitimate, and is helpful for those who don’t yet understand descendant selectors. It certainly isn’t invalid. And so I say, “Not necessarily.” Like many things, ‘tain’t black ‘n white.

As you point out, if you’re picky about it, it’s easy enough to customize. I do exactly that for several tags, like permlink, for example.

Offline

#6 2006-11-25 18:23:27

minimal design
Member
Registered: 2006-10-15
Posts: 38

Re: Too many default css classe/id

Allow me to be a pain in the A$$ just that one time :)

I’m not saying it’s invalid, just that it’s bad. The semantical correctness of a document comes from the HTML tags you use, not the names of the CSS class/id you pick (although something like .main_content is certainly better that .stuff_in_the_middle …).

If there’s a legitimate reason to mark something up like:

<p class="the_class"><a href="#" title="a link" class="the_class">a link</a></p>

So that you can call it w/ a.the_class instead of .the_class a I want to see an example…

And I really don’t think a CMS should have its CSS designed for people who don’t understand the super basics of CSS 101… ok, I’m done – sorry for the rant. I guess it’s the “picky” that got me… I feel better now ;)

Offline

#7 2006-11-26 05:36:06

TheEric
Plugin Author
From: Wyoming
Registered: 2004-09-17
Posts: 566

Re: Too many default css classe/id

minimal design wrote:

I’m not saying it’s invalid, just that it’s bad.

Psst. If you dislike something, it’s really quite easy to submit a patch.

Offline

#8 2006-11-26 07:59:08

hcgtv
Plugin Author
From: Key Largo, Florida
Registered: 2005-11-29
Posts: 2,722
Website

Re: Too many default css classe/id

minimal design wrote:

And I really don’t think a CMS should have its CSS designed for people who don’t understand the super basics of CSS 101…

I’m curious, could you elaborate on this?

Offline

#9 2006-12-03 13:12:17

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: Too many default css classe/id

I think what she’s trying to suggest, albeit not very eloquently, is that Txp has a bit of rigidity with respect to selectors and how their implemented/used (artifacts from history, no doubt); but if I’m not mistaken, what Sencer is indicating here about bi-directional development…well, that holds a lot of exciting promise for Txp 4.1 followers like I intend to be.

Offline

#10 2006-12-03 15:36:04

minimal design
Member
Registered: 2006-10-15
Posts: 38

Re: Too many default css classe/id

hcgtv wrote:

minimal design wrote: And I really don’t think a CMS should have its CSS designed for people who don’t understand the super basics of CSS 101…

I’m curious, could you elaborate on this?

It refers to what’‘s written above and has 2 parts to it. About some of the CSS defaults you get in Txp… Mary was saying it could be perfectly legitimate to have a class attached to and element and the same class attached to the elements inside of it, something like:

<p class="the_class"><a href="#" title="a link" class="the_class">a link</a></p>

I argued that there’s no legitimate case where this would be necessary and it’s just poorly written CSS, period. Then she said it could be useful for people who don’t understand the idea of “cascading” in CSS, which I referred in my usual tactful way as “basic CSS 101” ;) I realize I don’t always use the most diplomatic language, but if you heard me say this, I actually wasn’t condescending or anything like that…

To elaborate on my original rant, I just feel that Txp default has too many classes added. I could probably help make the default Txp install look just the same while turning a lot of the default to “” but I can’t argue w/ the backward compatibility thing. It’s a fact and I understand they want to keep all the stuff in there just in case someone’s using it.

Hope that clarifies what I was trying to say :)

Last edited by minimal design (2006-12-03 15:44:31)

Offline

#11 2006-12-03 17:10:29

hcgtv
Plugin Author
From: Key Largo, Florida
Registered: 2005-11-29
Posts: 2,722
Website

Re: Too many default css classe/id

minimal design wrote:

To elaborate on my original rant, I just feel that Txp default has too many classes added. I could probably help make the default Txp install look just the same while turning a lot of the default to “” but I can’t argue w/ the backward compatibility thing. It’s a fact and I understand they want to keep all the stuff in there just in case someone’s using it.

Backward compatibility doesn’t make sense to me since the defaults are only added to the database at time of install, never on an upgrade. So even if the CSS was streamlined along with removing unused pages and forms, it would have no bearing on current user but would make it easier on new users.

Offline

#12 2006-12-03 18:32:30

minimal design
Member
Registered: 2006-10-15
Posts: 38

Re: Too many default css classe/id

I didn’t know that. The it would seem that we could definitely give Txp a little CSS/HTML refresh… I’ll look around and see how it works to submit code to devs

Offline

Board footer

Powered by FluxBB