Make WordPress Core

Opened 19 years ago

Closed 17 years ago

#1802 closed defect (bug) (wontfix)

Underscores not valid in CSS class/id names

Reported by: dougal's profile dougal Owned by: rob1n's profile rob1n
Milestone: Priority: low
Severity: trivial Version: 1.6
Component: Administration Keywords: css validation
Focuses: Cc:


We're generating class names like "current_page_item", which are invalid in CSS. The underscores should be replaced with dashes.

I'm flagging this for version 1.6, but this is present in the 1.5 codebase, too. So if we do another 1.5 point release (unlikely, though I know we considered it), we might as well patch it there, too.

Attachments (1)

underscores.txt (756 bytes) - added by markjaquith 19 years ago.
List of all underscored class/id names

Download all attachments as: .zip

Change History (12)

19 years ago

List of all underscored class/id names

#1 @markjaquith
19 years ago

underscores.txt was generated with this command:

$ grep -iRoE '(id|class)="[a-z]*_[a-z]*"' * | grep -o '".*"' | replace '"' '' | sort | uniq > underscores.txt

#2 @link92
19 years ago

  • Owner changed from anonymous to link92
  • Status changed from new to assigned

#3 @link92
19 years ago

That doesn't give me any errors under either the XHTML or CSS validator.

#5 @dougal
19 years ago

I wasn't aware that underscores were made valid in the errata. So I guess they're technically legal now. Considering the effort vs the impact, it may not be worth worrying about after all. Personally, I'll probably continue to use dashes in my class names, because it's a long-standing habit of mine now :)

#6 @davidhouse
18 years ago

  • Severity changed from normal to trivial

I'd still say we should follow devmo's guidelines, if anyone feels like patching this up that would be appreciated.

#7 @link92
18 years ago

  • Owner link92 deleted
  • Status changed from assigned to new

#8 @link92
18 years ago

I don't have the time to work on it. I accepted it when I seemed like I had time, but, alas, I have been busy for ages.

#9 @Nazgul
18 years ago

  • Milestone set to 2.2

#10 @rob1n
17 years ago

  • Owner set to rob1n
  • Status changed from new to assigned

#11 @rob1n
17 years ago

  • Milestone 2.2 deleted
  • Resolution set to wontfix
  • Status changed from assigned to closed

I'm going to close this as wontfix, actually. *Technically* underscores are allowed in CSS classes and ID's, and if we changed it now, we would break backwards compatibility a few times over. So it's not worth the effort.

Note: See TracTickets for help on using tickets.