WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 19 months ago

#42819 closed enhancement (maybelater)

dashicons css: load woff file instead of inline embed base64 code in dashicons.css

Reported by: Matthias Reuter Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.8
Component: Administration Keywords: has-patch
Focuses: performance Cc:

Description

Currently, the woff code is embed into the /wp-includes/css/dashicons.css aswell as /wp-includes/css/dashicons.min.css as base64 code.

Due to performance purposes, the code should be changed to:

@font-face {
	font-family: dashicons;
		src: url(/wp-includes/fonts/dashicons.woff),
		url(/wp-includes/fonts/dashicons.ttf) format("truetype"),
		url(/wp-includes/fonts/dashicons.svg#dashicons) format("svg"),
		url(/wp-includes/fonts/dashicons.eot);
	font-weight: normal;
	font-style: normal;
}

Attachments (1)

42819.patch (35.0 KB) - added by Shital Patel 3 years ago.
I have added Patch for dashicons css

Download all attachments as: .zip

Change History (6)

#1 @Matthias Reuter
3 years ago

To keep the relative paths in the dashicons.css, here's a better version of the improvement

@font-face {
	font-family: dashicons;
    src: url(/wp-includes/fonts/dashicons.woff),
		url(../fonts/dashicons.ttf) format("truetype"),
		url(../fonts/dashicons.svg#dashicons) format("svg"),
		url(../fonts/dashicons.eot);
	font-weight: normal;
	font-style: normal;
}

@Shital Patel
3 years ago

I have added Patch for dashicons css

#2 @Shital Patel
3 years ago

  • Keywords has-patch added

#3 @Shital Patel
2 years ago

  • Keywords needs-testing added

#4 @desrosj
19 months ago

  • Component changed from General to Administration
  • Keywords needs-testing removed
  • Milestone Awaiting Review deleted
  • Version changed from 4.9.1 to 3.8

Hi @matthias-reuter,

Thanks for opening this!

Any changes to the Dashicons font need to be made on the Dashicons GitHub repository. Please open an issue or PR with details about this request.

Currently, there is only one font format included in the CSS with base64, WOFF. I was not involved directly with this decision, but I am almost positive it's because the build process used for Dashicons only supports creating a .woff2 file, not .woff. But, embedded WOFF is still supported.

Additionally, WOFF is an outdated format. It has been replaced by WOFF2. Only IE cannot use WOFF2, so this is maintained for backwards compatibility since IE11 is still supported in Core.

#5 @desrosj
19 months ago

  • Resolution set to maybelater
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.