Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish 4 new icons and 10 updated icons #3315

Merged
merged 10 commits into from
Jul 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
665 changes: 375 additions & 290 deletions .svglint-ignored.json

Large diffs are not rendered by default.

32 changes: 29 additions & 3 deletions .svglintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ const { htmlFriendlyToTitle } = require("./scripts/utils.js");
const getBounds = require("svg-path-bounding-box");

const titleRegexp = /(.+) icon$/;
const svgRegexp = /^<svg.*<\/svg>\r?\n?$/;
const svgRegexp = /^<svg( [^\s]*=".*"){3}><title>.*<\/title><path d=".*"\/><\/svg>\r?\n?$/;

const iconSize = 24;
const iconFloatPrecision = 3;
const iconTolerance = 0.001;
const iconIgnored = require("./.svglint-ignored.json");

module.exports = {
Expand Down Expand Up @@ -58,7 +59,7 @@ module.exports = {
reporter.name = "icon-size";

const iconPath = $.find("path").attr("d");
if (iconIgnored.hasOwnProperty(iconPath)) {
if (iconIgnored.size.hasOwnProperty(iconPath)) {
return;
}

Expand All @@ -77,9 +78,34 @@ module.exports = {

const rawSVG = $.html();
if (!svgRegexp.test(rawSVG)) {
reporter.error("Unexpected character(s) detected outside the opening and/or closing <svg> tags");
reporter.error("Unexpected character(s), most likely extraneous whitespace, detected in SVG markup");
}
},
function(reporter, $, ast) {
reporter.name = "icon-centered";
const iconPath = $.find("path").attr("d");
const bounds = getBounds(iconPath);

if (
iconIgnored.size.hasOwnProperty(iconPath) ||
iconIgnored.center.hasOwnProperty(iconPath)
) {
return
}

const targetCenter = iconSize / 2;
const centerX = +((bounds.minX + bounds.maxX) / 2).toFixed(iconFloatPrecision);
const devianceX = centerX - targetCenter;
const centerY = +((bounds.minY + bounds.maxY) / 2).toFixed(iconFloatPrecision);
const devianceY = centerY - targetCenter;

if (
Math.abs(devianceX) > iconTolerance ||
Math.abs(devianceY) > iconTolerance
) {
reporter.error(`<path> must be centered at (${targetCenter}, ${targetCenter}); the center is currently (${centerX}, ${centerY})`);
}
}
]
}
};
26 changes: 23 additions & 3 deletions _data/simple-icons.json
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@
},
{
"title": "Basecamp",
"hex": "5ECC62",
"hex": "1D2D35",
"source": "https://basecamp.com/about/press"
},
{
Expand Down Expand Up @@ -1665,6 +1665,11 @@
"hex": "212121",
"source": "https://github.com/drone/brand"
},
{
"title": "Drooble",
"hex": "19C4BE",
"source": "https://blog.drooble.com/press/"
},
{
"title": "Dropbox",
"hex": "0061FF",
Expand Down Expand Up @@ -2925,6 +2930,11 @@
"hex": "EA1D2C",
"source": "https://ifood.com.br/"
},
{
"title": "IFTTT",
"hex": "000000",
"source": "https://ifttt.com/discover/brand-guidelines"
},
{
"title": "iHeartRadio",
"hex": "C6002B",
Expand Down Expand Up @@ -3150,6 +3160,11 @@
"hex": "5091CD",
"source": "https://docs.joomla.org/Joomla:Brand_Identity_Elements"
},
{
"title": "JPEG",
"hex": "8A8A8A",
"source": "https://jpeg.org/contact.html"
},
{
"title": "jQuery",
"hex": "0769AD",
Expand Down Expand Up @@ -4192,8 +4207,8 @@
},
{
"title": "Nucleo",
"hex": "766DCC",
"source": "https://nucleoapp.com/wp-content/themes/nucleo-webapp-12/img/logo.svg"
"hex": "111111",
"source": "https://nucleoapp.com/"
},
{
"title": "NuGet",
Expand Down Expand Up @@ -4570,6 +4585,11 @@
"hex": "F86001",
"source": "https://www.pjsip.org/favicon.ico"
},
{
"title": "Planet",
"hex": "009DB1",
"source": "https://www.planet.com/explorer/"
},
{
"title": "PlanGrid",
"hex": "0085DE",
Expand Down
2 changes: 1 addition & 1 deletion icons/ardour.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion icons/basecamp.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion icons/celery.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion icons/centos.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion icons/cloudsmith.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion icons/deepin.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions icons/drooble.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions icons/ifttt.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion icons/jetbrains.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions icons/jpeg.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.