rename octicons.svg to octicons-16.svg and remove size suffix from IDs
authorDan Allen <dan@opendevise.com>
Wed, 30 Dec 2020 09:55:26 +0000 (02:55 -0700)
committerDan Allen <dan@opendevise.com>
Wed, 30 Dec 2020 09:55:26 +0000 (02:55 -0700)
gulp.d/tasks/build.js
src/img/octicons-16.svg [new file with mode: 0644]
src/img/octicons.svg [deleted file]
src/js/06-copy-to-clipboard.js

index 64642ad..6f213e2 100644 (file)
@@ -110,7 +110,7 @@ module.exports = (src, dest, preview) => () => {
             imagemin.optipng(),
             imagemin.svgo({
               plugins: [
-                { cleanupIDs: { preservePrefixes: ['symbol-', 'view-'] } },
+                { cleanupIDs: { preservePrefixes: ['icon-', 'view-'] } },
                 { removeViewBox: false },
                 { removeDesc: false },
               ],
diff --git a/src/img/octicons-16.svg b/src/img/octicons-16.svg
new file mode 100644 (file)
index 0000000..d8415d0
--- /dev/null
@@ -0,0 +1,36 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
+  <title>Octicons (16px subset)</title>
+  <desc>Octicons v11.2.0 by GitHub - https://primer.style/octicons/ - License: MIT</desc>
+  <metadata
+    xmlns:dc="http://purl.org/dc/elements/1.1/"
+    xmlns:cc="http://creativecommons.org/ns#"
+    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+    <rdf:RDF>
+      <cc:Work rdf:about="">
+        <dc:title>@primer/octicons</dc:title>
+        <dc:identifier>11.2.0</dc:identifier>
+        <dc:description>A scalable set of icons handcrafted with &lt;3 by GitHub</dc:description>
+        <dc:format>image/svg+xml</dc:format>
+        <dc:creator>
+          <cc:Agent>
+            <dc:title>GitHub</dc:title>
+          </cc:Agent>
+        </dc:creator>
+        <dc:rights>
+          <cc:Agent>
+            <dc:title>Copyright (c) 2020 GitHub Inc.</dc:title>
+          </cc:Agent>
+        </dc:rights>
+        <cc:license rdf:resource="https://opensource.org/licenses/MIT" />
+        <dc:relation>https://primer.style/octicons/</dc:relation>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <symbol id="icon-clippy" viewBox="0 0 16 16">
+    <path
+       fill-rule="evenodd"
+       d="M5.75 1a.75.75 0 00-.75.75v3c0 .414.336.75.75.75h4.5a.75.75 0 00.75-.75v-3a.75.75 0 00-.75-.75h-4.5zm.75 3V2.5h3V4h-3zm-2.874-.467a.75.75 0 00-.752-1.298A1.75 1.75 0 002 3.75v9.5c0 .966.784 1.75 1.75 1.75h8.5A1.75 1.75 0 0014 13.25v-9.5a1.75 1.75 0 00-.874-1.515.75.75 0 10-.752 1.298.25.25 0 01.126.217v9.5a.25.25 0 01-.25.25h-8.5a.25.25 0 01-.25-.25v-9.5a.25.25 0 01.126-.217z" />
+  </symbol>
+  <use href="#icon-clippy" width="16" height="16" x="0" y="0" />
+  <view id="view-clippy" viewBox="0 0 16 16" />
+</svg>
diff --git a/src/img/octicons.svg b/src/img/octicons.svg
deleted file mode 100644 (file)
index 3503b58..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg">
-  <title>Octicons (subset)</title>
-  <desc>Octicons v11.2.0 by GitHub - https://primer.style/octicons/ - License: MIT</desc>
-  <metadata
-    xmlns:dc="http://purl.org/dc/elements/1.1/"
-    xmlns:cc="http://creativecommons.org/ns#"
-    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
-    <rdf:RDF>
-      <cc:Work rdf:about="">
-        <dc:title>@primer/octicons</dc:title>
-        <dc:identifier>11.2.0</dc:identifier>
-        <dc:description>A scalable set of icons handcrafted with &lt;3 by GitHub</dc:description>
-        <dc:format>image/svg+xml</dc:format>
-        <dc:creator>
-          <cc:Agent>
-            <dc:title>GitHub</dc:title>
-          </cc:Agent>
-        </dc:creator>
-        <dc:rights>
-          <cc:Agent>
-            <dc:title>Copyright (c) 2020 GitHub Inc.</dc:title>
-          </cc:Agent>
-        </dc:rights>
-        <cc:license rdf:resource="https://opensource.org/licenses/MIT" />
-        <dc:relation>https://primer.style/octicons/</dc:relation>
-      </cc:Work>
-    </rdf:RDF>
-  </metadata>
-  <symbol id="symbol-clippy-16" viewBox="0 0 16 16">
-    <path
-       fill-rule="evenodd"
-       d="M5.75 1a.75.75 0 00-.75.75v3c0 .414.336.75.75.75h4.5a.75.75 0 00.75-.75v-3a.75.75 0 00-.75-.75h-4.5zm.75 3V2.5h3V4h-3zm-2.874-.467a.75.75 0 00-.752-1.298A1.75 1.75 0 002 3.75v9.5c0 .966.784 1.75 1.75 1.75h8.5A1.75 1.75 0 0014 13.25v-9.5a1.75 1.75 0 00-.874-1.515.75.75 0 10-.752 1.298.25.25 0 01.126.217v9.5a.25.25 0 01-.25.25h-8.5a.25.25 0 01-.25-.25v-9.5a.25.25 0 01.126-.217z" />
-  </symbol>
-  <use href="#symbol-clippy-16" width="16" height="16" x="0" y="0" />
-  <view id="view-clippy-16" viewBox="0 0 16 16" />
-</svg>
index 4749373..cc9a270 100644 (file)
@@ -34,7 +34,7 @@
       svg.setAttribute('aria-hidden', 'true')
       svg.setAttribute('class', 'copy-icon')
       var use = document.createElementNS('http://www.w3.org/2000/svg', 'use')
-      use.setAttribute('href', window.uiRootPath + '/img/octicons.svg#symbol-clippy-16')
+      use.setAttribute('href', window.uiRootPath + '/img/octicons-16.svg#icon-clippy')
       svg.appendChild(use)
       copy.appendChild(svg)
       ;(toast = document.createElement('span')).className = 'copy-toast'