From dec3f337dc6cd0092baeb6409da4ad31eb48c126 Mon Sep 17 00:00:00 2001 From: Lexi Mattick Date: Fri, 27 Feb 2026 08:03:15 -0800 Subject: [PATCH 1/2] Add and fix regression tests --- script/test-svg.spec.ts | 105 +++++++++++++++++-- src/svg/event/222.svg | 2 +- src/svg/event/333.svg | 2 +- src/svg/event/333bf.svg | 2 +- src/svg/event/333fm.svg | 2 +- src/svg/event/333ft.svg | 2 +- src/svg/event/333mbf.svg | 2 +- src/svg/event/333mbo.svg | 2 +- src/svg/event/333oh.svg | 2 +- src/svg/event/444.svg | 2 +- src/svg/event/444bf.svg | 2 +- src/svg/event/555.svg | 2 +- src/svg/event/555bf.svg | 2 +- src/svg/event/666.svg | 2 +- src/svg/event/777.svg | 2 +- src/svg/event/magic.svg | 2 +- src/svg/event/minx.svg | 2 +- src/svg/event/mmagic.svg | 2 +- src/svg/event/pyram.svg | 2 +- src/svg/event/skewb.svg | 2 +- src/svg/event/sq1.svg | 2 +- src/svg/penalty/10e3.svg | 2 +- src/svg/unofficial/222bf.svg | 2 +- src/svg/unofficial/222oh.svg | 2 +- src/svg/unofficial/234567relay.svg | 2 +- src/svg/unofficial/234567relay_2_person.svg | 2 +- src/svg/unofficial/23456relay.svg | 2 +- src/svg/unofficial/2345relay.svg | 2 +- src/svg/unofficial/234relay.svg | 2 +- src/svg/unofficial/333_linear_fm.svg | 2 +- src/svg/unofficial/333_mirror_blocks.svg | 2 +- src/svg/unofficial/333_mirror_blocks_bld.svg | 2 +- src/svg/unofficial/333_oh_bld_relay.svg | 2 +- src/svg/unofficial/333_oh_bld_team_relay.svg | 2 +- src/svg/unofficial/333_oven_mitts.svg | 66 +----------- src/svg/unofficial/333_siamese.svg | 2 +- src/svg/unofficial/333_speed_bld.svg | 2 +- src/svg/unofficial/333_team_bld.svg | 2 +- src/svg/unofficial/333_team_factory.svg | 2 +- src/svg/unofficial/333bf_2_person_relay.svg | 2 +- src/svg/unofficial/333bf_3_person_relay.svg | 2 +- src/svg/unofficial/333bf_4_person_relay.svg | 2 +- src/svg/unofficial/333bf_8_person_relay.svg | 2 +- src/svg/unofficial/333mts.svg | 2 +- src/svg/unofficial/444ft.svg | 2 +- src/svg/unofficial/666bf.svg | 2 +- src/svg/unofficial/777bf.svg | 2 +- src/svg/unofficial/baby_fto.svg | 2 +- src/svg/unofficial/cmetrick_mini.svg | 2 +- src/svg/unofficial/crazy_333.svg | 2 +- src/svg/unofficial/curvycopter.svg | 2 +- src/svg/unofficial/fisher.svg | 2 +- src/svg/unofficial/fto.svg | 2 +- src/svg/unofficial/gear.svg | 2 +- src/svg/unofficial/gigaminx.svg | 2 +- src/svg/unofficial/helicopter.svg | 2 +- src/svg/unofficial/ivy.svg | 2 +- src/svg/unofficial/kilominx.svg | 2 +- src/svg/unofficial/magic_oh.svg | 2 +- src/svg/unofficial/miniguild.svg | 2 +- src/svg/unofficial/miniguild_2_person.svg | 2 +- src/svg/unofficial/miniguild_bld.svg | 2 +- src/svg/unofficial/minx_bld.svg | 2 +- src/svg/unofficial/mpyram.svg | 2 +- src/svg/unofficial/mskewb.svg | 2 +- src/svg/unofficial/mtetram.svg | 2 +- src/svg/unofficial/pyraminx_crystal.svg | 2 +- src/svg/unofficial/pyramorphix.svg | 2 +- src/svg/unofficial/redi.svg | 2 +- src/svg/unofficial/sq1_bld.svg | 2 +- src/svg/unofficial/sq2.svg | 2 +- src/svg/unofficial/super_sq1.svg | 2 +- src/svg/unofficial/ufo.svg | 2 +- 73 files changed, 170 insertions(+), 143 deletions(-) diff --git a/script/test-svg.spec.ts b/script/test-svg.spec.ts index b22ae4d..11adaec 100644 --- a/script/test-svg.spec.ts +++ b/script/test-svg.spec.ts @@ -6,16 +6,34 @@ import { JSDOM } from "jsdom"; // Collect into an array so we can iterate over it again multiple times. const svgFiles = await Array.fromAsync(new Glob("./src/svg/*/*.svg").scan()); -test("SVG files are all 500×500", async () => { +/** + * Helper so TypeScript can infer `expect(...).not.toBeNull()`. + */ +function expectNotNull( + value: T | null, + message: string, +): asserts value is T { + expect(value, message).not.toBeNull(); +} + +test.concurrent("SVG files are all 500×500", async () => { let numSVGs = 0; for await (const svgFile of svgFiles) { numSVGs++; const svgElem = new JSDOM( await file(svgFile).text(), ).window.document.querySelector("svg"); - expect(svgElem).not.toBeNull(); - expect(svgElem?.getAttribute("width")).toEqual("500"); - expect(svgElem?.getAttribute("height")).toEqual("500"); + expectNotNull(svgElem, `${svgFile}: no svg`); + expect(svgElem?.getAttribute("width"), `${svgFile}: wrong width`).toEqual( + "500", + ); + expect(svgElem?.getAttribute("height"), `${svgFile}: wrong height`).toEqual( + "500", + ); + expect( + svgElem?.getAttribute("viewBox"), + `${svgFile}: wrong viewBox`, + ).toEqual("0 0 500 500"); } /** @@ -27,17 +45,19 @@ test("SVG files are all 500×500", async () => { expect(numSVGs).toBeGreaterThan(50); }); -test("SVG files follow naming conventions", async () => { +test.concurrent("SVG files follow naming conventions", async () => { let numSVGs = 0; for await (const svgFile of svgFiles) { numSVGs++; const parentFolder = basename(dirname(svgFile)); if (parentFolder === "penalty") { - expect(basename(svgFile)).toMatch( + expect(basename(svgFile), `${svgFile}: wrong basename`).toMatch( /^([A-Z]+\d+([a-z]+\d*)?|\d+[a-z]+(\d+[a-z]*)?)\.svg$/, ); } else { - expect(basename(svgFile)).toMatch(/^[a-z0-9_]+\.svg$/); + expect(basename(svgFile), `${svgFile}: wrong basename`).toMatch( + /^[a-z0-9_]+\.svg$/, + ); } } @@ -49,3 +69,74 @@ test("SVG files follow naming conventions", async () => { */ expect(numSVGs).toBeGreaterThan(50); }); + +test.concurrent("SVGs have no hardcoded colors", async () => { + for await (const svgFile of svgFiles) { + function checkElement(el: SVGElement) { + expect(el.getAttribute("fill"), `${svgFile}: has fill color`).toBeNull(); + expect( + el.getAttribute("stroke"), + `${svgFile}: has stroke color`, + ).toBeNull(); + expect( + el.style.getPropertyValue("fill"), + `${svgFile}: has inline fill color`, + ).toBe(""); + expect( + el.style.getPropertyValue("stroke"), + `${svgFile}: has inline stroke color`, + ).toBe(""); + + for (const child of el.children) { + checkElement(child as SVGElement); + } + } + + const svgElem = new JSDOM( + await file(svgFile).text(), + ).window.document.querySelector("svg"); + + expectNotNull(svgElem, `${svgFile}: no svg`); + checkElement(svgElem); + } +}); + +test.concurrent("SVGs are well-formed with no extraneous attributes", async () => { + for await (const svgFile of svgFiles) { + const svgElem = new JSDOM( + await file(svgFile).text(), + ).window.document.querySelector("svg"); + + expectNotNull(svgElem, `${svgFile}: no svg`); + expect(svgElem.getAttribute("xmlns"), `${svgFile}: bad xmlns`).toBe( + "http://www.w3.org/2000/svg", + ); + expect( + svgElem.getAttributeNames().sort(), + `${svgFile}: wrong attributes`, + ).toEqual(["width", "height", "viewBox", "xmlns"].sort()); + } +}); + +const ALLOWED_ELEMENTS = ["svg", "g", "path", "circle", "defs"]; + +test.concurrent("SVGs only have allowed elements", async () => { + for await (const svgFile of svgFiles) { + function checkElement(el: Element) { + expect(el.tagName, `${svgFile}: disallowed element`).toBeOneOf( + ALLOWED_ELEMENTS, + ); + + for (const child of el.children) { + checkElement(child as Element); + } + } + + const svgElem = new JSDOM( + await file(svgFile).text(), + ).window.document.querySelector("svg"); + + expectNotNull(svgElem, `${svgFile}: no svg`); + checkElement(svgElem); + } +}); diff --git a/src/svg/event/222.svg b/src/svg/event/222.svg index e427d6e..578b6c1 100644 --- a/src/svg/event/222.svg +++ b/src/svg/event/222.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/event/333.svg b/src/svg/event/333.svg index af8cdcd..bc079a4 100644 --- a/src/svg/event/333.svg +++ b/src/svg/event/333.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/event/333bf.svg b/src/svg/event/333bf.svg index aa5d6b4..7138079 100644 --- a/src/svg/event/333bf.svg +++ b/src/svg/event/333bf.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/event/333fm.svg b/src/svg/event/333fm.svg index cfc2250..ab27134 100644 --- a/src/svg/event/333fm.svg +++ b/src/svg/event/333fm.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/event/333ft.svg b/src/svg/event/333ft.svg index 55e6152..fa3d9ec 100644 --- a/src/svg/event/333ft.svg +++ b/src/svg/event/333ft.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/event/333mbf.svg b/src/svg/event/333mbf.svg index 20ce654..1a77c5c 100644 --- a/src/svg/event/333mbf.svg +++ b/src/svg/event/333mbf.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/event/333mbo.svg b/src/svg/event/333mbo.svg index 5689cba..c1a7121 100644 --- a/src/svg/event/333mbo.svg +++ b/src/svg/event/333mbo.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/event/333oh.svg b/src/svg/event/333oh.svg index ffc66b3..33ec8ef 100644 --- a/src/svg/event/333oh.svg +++ b/src/svg/event/333oh.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/event/444.svg b/src/svg/event/444.svg index 2c555c7..2fa8aff 100644 --- a/src/svg/event/444.svg +++ b/src/svg/event/444.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/event/444bf.svg b/src/svg/event/444bf.svg index f7a4c55..16c77da 100644 --- a/src/svg/event/444bf.svg +++ b/src/svg/event/444bf.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/event/555.svg b/src/svg/event/555.svg index 52ed1a5..7de2fd0 100644 --- a/src/svg/event/555.svg +++ b/src/svg/event/555.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/event/555bf.svg b/src/svg/event/555bf.svg index ee63749..73a6b2b 100644 --- a/src/svg/event/555bf.svg +++ b/src/svg/event/555bf.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/event/666.svg b/src/svg/event/666.svg index 7df1fe2..62f64a4 100644 --- a/src/svg/event/666.svg +++ b/src/svg/event/666.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/event/777.svg b/src/svg/event/777.svg index 41a087c..5a48c0d 100644 --- a/src/svg/event/777.svg +++ b/src/svg/event/777.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/event/magic.svg b/src/svg/event/magic.svg index 7764675..a7d7c9a 100644 --- a/src/svg/event/magic.svg +++ b/src/svg/event/magic.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/event/minx.svg b/src/svg/event/minx.svg index f5d9033..0dd3321 100644 --- a/src/svg/event/minx.svg +++ b/src/svg/event/minx.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/event/mmagic.svg b/src/svg/event/mmagic.svg index d4afd8b..77d36cc 100644 --- a/src/svg/event/mmagic.svg +++ b/src/svg/event/mmagic.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/event/pyram.svg b/src/svg/event/pyram.svg index 4339435..b6589db 100644 --- a/src/svg/event/pyram.svg +++ b/src/svg/event/pyram.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/event/skewb.svg b/src/svg/event/skewb.svg index 64cc973..e5052c2 100644 --- a/src/svg/event/skewb.svg +++ b/src/svg/event/skewb.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/event/sq1.svg b/src/svg/event/sq1.svg index 3011b17..2d923ac 100644 --- a/src/svg/event/sq1.svg +++ b/src/svg/event/sq1.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/penalty/10e3.svg b/src/svg/penalty/10e3.svg index 9170d69..e6791da 100644 --- a/src/svg/penalty/10e3.svg +++ b/src/svg/penalty/10e3.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/222bf.svg b/src/svg/unofficial/222bf.svg index 1bf9ecb..23e2eb5 100644 --- a/src/svg/unofficial/222bf.svg +++ b/src/svg/unofficial/222bf.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/222oh.svg b/src/svg/unofficial/222oh.svg index b5ad205..63738a9 100644 --- a/src/svg/unofficial/222oh.svg +++ b/src/svg/unofficial/222oh.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/234567relay.svg b/src/svg/unofficial/234567relay.svg index 49d550a..d949f7b 100644 --- a/src/svg/unofficial/234567relay.svg +++ b/src/svg/unofficial/234567relay.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/234567relay_2_person.svg b/src/svg/unofficial/234567relay_2_person.svg index 38842ce..8bbc70f 100644 --- a/src/svg/unofficial/234567relay_2_person.svg +++ b/src/svg/unofficial/234567relay_2_person.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/23456relay.svg b/src/svg/unofficial/23456relay.svg index 7e8e93a..7cd5f6d 100644 --- a/src/svg/unofficial/23456relay.svg +++ b/src/svg/unofficial/23456relay.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/2345relay.svg b/src/svg/unofficial/2345relay.svg index 4dbe865..e9520a9 100644 --- a/src/svg/unofficial/2345relay.svg +++ b/src/svg/unofficial/2345relay.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/234relay.svg b/src/svg/unofficial/234relay.svg index c014603..0cb7bd7 100644 --- a/src/svg/unofficial/234relay.svg +++ b/src/svg/unofficial/234relay.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/333_linear_fm.svg b/src/svg/unofficial/333_linear_fm.svg index e10895c..cc14169 100644 --- a/src/svg/unofficial/333_linear_fm.svg +++ b/src/svg/unofficial/333_linear_fm.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/333_mirror_blocks.svg b/src/svg/unofficial/333_mirror_blocks.svg index 3c9e019..12acf68 100644 --- a/src/svg/unofficial/333_mirror_blocks.svg +++ b/src/svg/unofficial/333_mirror_blocks.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/333_mirror_blocks_bld.svg b/src/svg/unofficial/333_mirror_blocks_bld.svg index 6986816..b2336ba 100644 --- a/src/svg/unofficial/333_mirror_blocks_bld.svg +++ b/src/svg/unofficial/333_mirror_blocks_bld.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/333_oh_bld_relay.svg b/src/svg/unofficial/333_oh_bld_relay.svg index 6da920e..ac04b4b 100644 --- a/src/svg/unofficial/333_oh_bld_relay.svg +++ b/src/svg/unofficial/333_oh_bld_relay.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/333_oh_bld_team_relay.svg b/src/svg/unofficial/333_oh_bld_team_relay.svg index 943456e..7288928 100644 --- a/src/svg/unofficial/333_oh_bld_team_relay.svg +++ b/src/svg/unofficial/333_oh_bld_team_relay.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/333_oven_mitts.svg b/src/svg/unofficial/333_oven_mitts.svg index 48efd76..b75e4a8 100644 --- a/src/svg/unofficial/333_oven_mitts.svg +++ b/src/svg/unofficial/333_oven_mitts.svg @@ -1,65 +1 @@ - - - - - - - - - - - - + \ No newline at end of file diff --git a/src/svg/unofficial/333_siamese.svg b/src/svg/unofficial/333_siamese.svg index 26da14d..4b8c9cb 100644 --- a/src/svg/unofficial/333_siamese.svg +++ b/src/svg/unofficial/333_siamese.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/333_speed_bld.svg b/src/svg/unofficial/333_speed_bld.svg index f8bf035..4656dd1 100644 --- a/src/svg/unofficial/333_speed_bld.svg +++ b/src/svg/unofficial/333_speed_bld.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/333_team_bld.svg b/src/svg/unofficial/333_team_bld.svg index ed4817b..178de98 100644 --- a/src/svg/unofficial/333_team_bld.svg +++ b/src/svg/unofficial/333_team_bld.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/333_team_factory.svg b/src/svg/unofficial/333_team_factory.svg index 33f5893..49c2e06 100644 --- a/src/svg/unofficial/333_team_factory.svg +++ b/src/svg/unofficial/333_team_factory.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/333bf_2_person_relay.svg b/src/svg/unofficial/333bf_2_person_relay.svg index 41f3a12..f482dfe 100644 --- a/src/svg/unofficial/333bf_2_person_relay.svg +++ b/src/svg/unofficial/333bf_2_person_relay.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/333bf_3_person_relay.svg b/src/svg/unofficial/333bf_3_person_relay.svg index cb9138b..714cce0 100644 --- a/src/svg/unofficial/333bf_3_person_relay.svg +++ b/src/svg/unofficial/333bf_3_person_relay.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/333bf_4_person_relay.svg b/src/svg/unofficial/333bf_4_person_relay.svg index 3027024..6e5cda2 100644 --- a/src/svg/unofficial/333bf_4_person_relay.svg +++ b/src/svg/unofficial/333bf_4_person_relay.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/333bf_8_person_relay.svg b/src/svg/unofficial/333bf_8_person_relay.svg index be2b2b4..14ec2c5 100644 --- a/src/svg/unofficial/333bf_8_person_relay.svg +++ b/src/svg/unofficial/333bf_8_person_relay.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/333mts.svg b/src/svg/unofficial/333mts.svg index fa02549..9e2fcd9 100644 --- a/src/svg/unofficial/333mts.svg +++ b/src/svg/unofficial/333mts.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/444ft.svg b/src/svg/unofficial/444ft.svg index ea127f4..fd85f36 100644 --- a/src/svg/unofficial/444ft.svg +++ b/src/svg/unofficial/444ft.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/666bf.svg b/src/svg/unofficial/666bf.svg index f7cf282..dc2d9ff 100644 --- a/src/svg/unofficial/666bf.svg +++ b/src/svg/unofficial/666bf.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/777bf.svg b/src/svg/unofficial/777bf.svg index 37ab3ba..a2c4c31 100644 --- a/src/svg/unofficial/777bf.svg +++ b/src/svg/unofficial/777bf.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/baby_fto.svg b/src/svg/unofficial/baby_fto.svg index aa5ccba..c2b5597 100644 --- a/src/svg/unofficial/baby_fto.svg +++ b/src/svg/unofficial/baby_fto.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/cmetrick_mini.svg b/src/svg/unofficial/cmetrick_mini.svg index 89451a3..621ef6c 100644 --- a/src/svg/unofficial/cmetrick_mini.svg +++ b/src/svg/unofficial/cmetrick_mini.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/crazy_333.svg b/src/svg/unofficial/crazy_333.svg index 73ef9ea..042cac3 100644 --- a/src/svg/unofficial/crazy_333.svg +++ b/src/svg/unofficial/crazy_333.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/curvycopter.svg b/src/svg/unofficial/curvycopter.svg index 4256925..2c3aba2 100644 --- a/src/svg/unofficial/curvycopter.svg +++ b/src/svg/unofficial/curvycopter.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/fisher.svg b/src/svg/unofficial/fisher.svg index bdb795f..3de3c3a 100644 --- a/src/svg/unofficial/fisher.svg +++ b/src/svg/unofficial/fisher.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/fto.svg b/src/svg/unofficial/fto.svg index e690e3f..18d3547 100644 --- a/src/svg/unofficial/fto.svg +++ b/src/svg/unofficial/fto.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/gear.svg b/src/svg/unofficial/gear.svg index 4ae3fcc..8b41581 100644 --- a/src/svg/unofficial/gear.svg +++ b/src/svg/unofficial/gear.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/gigaminx.svg b/src/svg/unofficial/gigaminx.svg index f6b476b..ba4716f 100644 --- a/src/svg/unofficial/gigaminx.svg +++ b/src/svg/unofficial/gigaminx.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/helicopter.svg b/src/svg/unofficial/helicopter.svg index 072ceb7..7447f3b 100644 --- a/src/svg/unofficial/helicopter.svg +++ b/src/svg/unofficial/helicopter.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/ivy.svg b/src/svg/unofficial/ivy.svg index 038921f..2fce159 100644 --- a/src/svg/unofficial/ivy.svg +++ b/src/svg/unofficial/ivy.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/kilominx.svg b/src/svg/unofficial/kilominx.svg index 14b5e92..0d7554f 100644 --- a/src/svg/unofficial/kilominx.svg +++ b/src/svg/unofficial/kilominx.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/magic_oh.svg b/src/svg/unofficial/magic_oh.svg index 3a332e9..08ec655 100644 --- a/src/svg/unofficial/magic_oh.svg +++ b/src/svg/unofficial/magic_oh.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/miniguild.svg b/src/svg/unofficial/miniguild.svg index 492804f..287f0bd 100644 --- a/src/svg/unofficial/miniguild.svg +++ b/src/svg/unofficial/miniguild.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/miniguild_2_person.svg b/src/svg/unofficial/miniguild_2_person.svg index 1e89bb3..d977598 100644 --- a/src/svg/unofficial/miniguild_2_person.svg +++ b/src/svg/unofficial/miniguild_2_person.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/miniguild_bld.svg b/src/svg/unofficial/miniguild_bld.svg index 80fd272..59e795a 100644 --- a/src/svg/unofficial/miniguild_bld.svg +++ b/src/svg/unofficial/miniguild_bld.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/minx_bld.svg b/src/svg/unofficial/minx_bld.svg index 6c6920b..3620485 100644 --- a/src/svg/unofficial/minx_bld.svg +++ b/src/svg/unofficial/minx_bld.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/mpyram.svg b/src/svg/unofficial/mpyram.svg index 41ecc46..2c7f696 100644 --- a/src/svg/unofficial/mpyram.svg +++ b/src/svg/unofficial/mpyram.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/mskewb.svg b/src/svg/unofficial/mskewb.svg index 69b06c9..00636bb 100644 --- a/src/svg/unofficial/mskewb.svg +++ b/src/svg/unofficial/mskewb.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/mtetram.svg b/src/svg/unofficial/mtetram.svg index a478067..ba76a86 100644 --- a/src/svg/unofficial/mtetram.svg +++ b/src/svg/unofficial/mtetram.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/pyraminx_crystal.svg b/src/svg/unofficial/pyraminx_crystal.svg index 918ea5f..117976c 100644 --- a/src/svg/unofficial/pyraminx_crystal.svg +++ b/src/svg/unofficial/pyraminx_crystal.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/pyramorphix.svg b/src/svg/unofficial/pyramorphix.svg index a08c81d..29a63f6 100644 --- a/src/svg/unofficial/pyramorphix.svg +++ b/src/svg/unofficial/pyramorphix.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/redi.svg b/src/svg/unofficial/redi.svg index fc9c349..9b29641 100644 --- a/src/svg/unofficial/redi.svg +++ b/src/svg/unofficial/redi.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/sq1_bld.svg b/src/svg/unofficial/sq1_bld.svg index 8070988..05b69e9 100644 --- a/src/svg/unofficial/sq1_bld.svg +++ b/src/svg/unofficial/sq1_bld.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/sq2.svg b/src/svg/unofficial/sq2.svg index 754d2f4..02b3721 100644 --- a/src/svg/unofficial/sq2.svg +++ b/src/svg/unofficial/sq2.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/super_sq1.svg b/src/svg/unofficial/super_sq1.svg index d5c38a0..33379fd 100644 --- a/src/svg/unofficial/super_sq1.svg +++ b/src/svg/unofficial/super_sq1.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/svg/unofficial/ufo.svg b/src/svg/unofficial/ufo.svg index be8254e..a1e8ba6 100644 --- a/src/svg/unofficial/ufo.svg +++ b/src/svg/unofficial/ufo.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file From ee363caefff3c53c3be92699c781eade8d02cac0 Mon Sep 17 00:00:00 2001 From: Lexi Mattick Date: Fri, 27 Feb 2026 15:51:57 -0800 Subject: [PATCH 2/2] Add contributing section to readme --- README.md | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4f019df..e3e8604 100644 --- a/README.md +++ b/README.md @@ -4,17 +4,27 @@ -## Development +## Contributing Most development is simply adding/changing existing SVG files under the -[`./src/svg` directory](https://github.com/cubing/icons/tree/main/src/svg). If -you haven't dealt with SVG files before, check out +[`./src/svg` directory](https://github.com/cubing/icons/tree/main/src/svg). + +To add a new icon, please follow the following steps: + +1. Make or edit your icon! All icons should be vector SVG files. If +you haven't dealt with SVGs before, check out [Inkscape](https://inkscape.org/). +1. Make sure your SVG is cleaned up and minified. You can just upload your SVG file to [SVGOMG](https://jakearchibald.github.io/svgomg/) and then download the output file using the default settings. +2. Name your icon in all lowercase, separating each word with an underscore. If specifying the dimensions of a cube in your icon, name, don't include any `x` symbols. (correct: `crazy_333.svg`, incorrect: `Crazy-3x3x3.SVG`) +3. Remove any borders and fill colors from the your icon. To do this, look inside the SVG file and remove anything that looks like `fill="..."` or `stroke="..."`. +4. Make a pull request here in GitHub adding your new icon file. -If you want to actually build a font or CSS locally, you'll need some more tooling. +Our maintainers can help you with any of the above steps if you need help. ### Build the project +If you want to actually build a font or CSS locally, you'll need some more tooling. + You'll need [`bun`](https://bun.sh) to install development dependencies and build the project. Either install `bun` with your preferred package manager, or use our [Nix-powered dev shell](#using-nix-for-development-optional).