Skip to content

Commit

Permalink
Release 4 new icons and 10 updated icons (v3.1.0)
Browse files Browse the repository at this point in the history
# New Icons

- Drooble (#3231)
- IFTTT (#3304)
- JPEG (#3303)
- Planet (#3274)

# Updated Icons

- Ardour (#3256)
- Basecamp (#3277)
- Celery (#3256)
- CentOS (#3256)
- Cloudsmith (#3256)
- deepin (#3256)
- JetBrains (#3256)
- KTM (#3256)
- Nucleo (#3285)
- uBlock Origin (#3256)
  • Loading branch information
github-actions[bot] committed Jul 14, 2020
2 parents 8746513 + 7c34d3f commit f769131
Show file tree
Hide file tree
Showing 20 changed files with 445 additions and 310 deletions.
665 changes: 375 additions & 290 deletions .svglint-ignored.json

Large diffs are not rendered by default.

32 changes: 29 additions & 3 deletions .svglintrc.js
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
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.

0 comments on commit f769131

Please sign in to comment.