Make WordPress Core

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#32866 closed defect (bug) (fixed)

dashicons CSS: one-word font families don't need quotes

Reported by: afercia's profile afercia Owned by: wonderboymusic's profile wonderboymusic
Milestone: 4.4 Priority: normal
Severity: normal Version: 4.2
Component: Administration Keywords: has-patch commit
Focuses: ui Cc:

Description

several times in the admin CSS the dashicons font family is referenced between single quotes, e.g.:
font: normal 20px/1 'dashicons';
found also some uppercase versions:
font: normal 40px/45px 'Dashicons';
with single-word font families there's no need for quotes.

Attachments (3)

32866.patch (18.7 KB) - added by afercia 9 years ago.
32866.2.patch (52.2 KB) - added by afercia 9 years ago.
32866.3.patch (54.2 KB) - added by afercia 9 years ago.

Download all attachments as: .zip

Change History (12)

@afercia
9 years ago

#1 @afercia
9 years ago

  • Keywords has-patch added

First pass.

@afercia
9 years ago

#2 @afercia
9 years ago

Refreshed patch to remove also the double quotes occurrences.

@afercia
9 years ago

#3 @afercia
9 years ago

  • Keywords commit added
  • Milestone changed from Awaiting Review to 4.4

Refreshed patch. Would be nice to have this in early in the release cycle.

#4 @wonderboymusic
9 years ago

seems fine to me

#5 follow-ups: @SergeyBiryukov
9 years ago

Should we perhaps add this to our CSS coding standards?

#6 in reply to: ↑ 5 @afercia
9 years ago

Replying to SergeyBiryukov:

Should we perhaps add this to our CSS coding standards?

See related discussion here: https://wordpress.slack.com/archives/design/p1435872121000919
Maybe just add something to the existing sentence:

Use double quotes rather than single quotes, and only when needed, such as when a font name has a space.

cc @helen

#7 @wonderboymusic
9 years ago

  • Owner set to wonderboymusic
  • Resolution set to fixed
  • Status changed from new to closed

In 33912:

Dashicons CSS: one-word font families don't need quotes. Font families with a space in the name should use double-quotes (doesn't apply here).

Props afercia.
Fixes #32866.

#8 in reply to: ↑ 5 ; follow-up: @netweb
9 years ago

Replying to SergeyBiryukov:

Should we perhaps add this to our CSS coding standards?

The "quote" part of this is already documented here:

The "font name" part of this is also already documented and is now against what was just committed in r33912:


All Dashicon font file names are lowercase: https://core.trac.wordpress.org/browser/trunk/src/wp-includes/fonts

dashicons.svg reports the font id as <font id="dashicons" horiz-adv-x="2000" >
dashicons.ttf reports the name on Mac OSX Font Book as Dashicons
The main GitHub repo https://github.com/melchoyce/dashicons uses Dashicons for font name.
The commit message of r33912 uses Dashicons as the font name

So the question is "Should this be reopened and all instances of the font name dashicons be replaced with Dashicons?" cc @helen @melchoyce

This is an advantage/disadvantage of working on the CSS lint task in #29792 and ensuring there is no ambiguity

#9 in reply to: ↑ 8 @afercia
9 years ago

Replying to netweb:

So the question is "Should this be reopened and all instances of the font name dashicons be replaced with Dashicons?" cc @helen @melchoyce

I think the name that matters here is the one used in the font-family descriptor in the @font-face rule, it's designed to override the original font name, meaning we could use also "foofoo" :).
http://www.w3.org/TR/css3-fonts/#font-family-desc

It overrides the font family names contained in the underlying font data

Unrelated: any chance to fix the Trac CSS for the blockquote? :) ^

Note: See TracTickets for help on using tickets.