In creating some styling docs for a designer, I've noticed something odd about the .links class:

For primary/secondary links, we have:
- No DIV wrapper
- UL: "links primary-links"
Taxonomy terms:
- DIV wrapper: "terms"
- UL: "links inline"
Node links:
- DIV wrapper: "links"
- UL: "links inline"

The only way to securely grab onto node links is to distinguish that the links class is on a DIV rather than a UL:
.links li {} // gets all links
div.links .links li

This doesn't make for very readable CSS and it's a bit confusing to have the same class name at two levels, meaning slightly different things.

I would suggest node-links for the wrapping DIV on node links.

CommentFileSizeAuthor
#1 node_links_class.patch3.64 KBjoachim

Comments

joachim’s picture

StatusFileSize
new3.64 KB

This is a patch for all the tpl files in core themes.

This is a bigger change than I initially thought, as there's a few .links rules in stylesheets that set things like padding that would have previously applied to both the enclosing div and the UL.
I'll wait for any +1s before diving in further :)

Jeff Burnz’s picture

Status: Active » Closed (won't fix)

Thinking this is way old and not really relevant anymore?

joachim’s picture

Category: feature » bug
Status: Closed (won't fix) » Needs review

Node links:
- DIV wrapper: "links"
- UL: "links inline"

This is still a problem in Garland. I'm going to say it's a bug, as it's lousy use of classes.

Status: Needs review » Needs work

The last submitted patch, node_links_class.patch, failed testing.

Status: Needs work » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.