WordPress / dashicons

Dashicons, the WordPress admin icon font. For the official resource, please see the WordPress Developer Hub.
https://developer.wordpress.org/resource/dashicons/
GNU General Public License v3.0
564 stars 185 forks source link

Re-add the `share1` and `plus-alt2` icons. #346

Closed desrosj closed 5 years ago

desrosj commented 5 years ago

The share1 icon currently exists in WordPress Core, but is missing from the most recent build in this repository. This icon should continue to be included for backwards compatibility.

This appears to be happening as a result of the build process changes. The characters for share and share1 are the same (f237). Because the icons are identical, no share1 file exists in the SVG directory. This causes the CSS definition to not be generated.

This PR manually adds the .dashicons-share1:before definition at the bottom of the css-template.css with the other manually defined icons and rebuilds.

desrosj commented 5 years ago

I have updated this PR to also manually define the plus-alt2 icon. This was introduced in 3614fbaa354869a370e99836c7f5f685dd5368eb (before the build script was introduced), but does not exist in the currently generated font. The plus-alt2 appears to be identical to the plus-light icon, which I am assuming was renamed when the build process was added.

The plus-alt2 icon was previously at a different unicode location, though. This location is still defined in the codepoints.json file. Not sure if this is the correct way to solve this.

jasmussen commented 5 years ago

Thanks for the PR, and thanks for this. This seems good to me (lucky, since it's already merged ;)) — and yes I think the right way to add back compat is to add the duplicate naming classes to the template.

The plus-alt2 icon was previously at a different unicode location, though. This location is still defined in the codepoints.json file. Not sure if this is the correct way to solve this.

Can you expand on this?

This is what I see in the json file: "share-alt2": 62018. If I run that through https://www.binaryhexconverter.com/decimal-to-hex-converter, that maps to f242

And in the built files, I I see this:

.dashicons-share-alt2:before {
    content: "\f242";
}

The font renders right:

Screenshot 2019-03-19 at 09 07 38

Which also happens to map to what's on the dev site, which I still believe uses the old font: https://developer.wordpress.org/resource/dashicons/#share-alt2

Screenshot 2019-03-19 at 09 10 40

So this all seems right to me. 👍 👍

field2 commented 5 years ago

Looks good to me as well. I can submit a new patch if that's the next step. PS- the file /index.html in the repo looks the same as https://developer.wordpress.org/resource/dashicons and has to be manually updated. /icon-font/dashicons.html however is an automated generation of the latest icons. It's also more user friendly as it shows the semantic name of each dashicon. Maybe we could use that for the developer page reference instead.

jeffpaul commented 5 years ago

@field2 are you able to submit a PR for those final updates?