]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-11014 support icons in documentation (#521)
authorStas Vilchik <stas.vilchik@sonarsource.com>
Wed, 18 Jul 2018 12:13:25 +0000 (14:13 +0200)
committerSonarTech <sonartech@sonarsource.com>
Wed, 25 Jul 2018 18:21:20 +0000 (20:21 +0200)
server/sonar-docs/src/images/check.svg [new file with mode: 0644]
server/sonar-docs/src/images/cross.svg [new file with mode: 0644]
server/sonar-docs/src/images/exclamation.svg [new file with mode: 0644]
server/sonar-docs/src/images/info.svg [new file with mode: 0644]
server/sonar-docs/src/templates/page.js
server/sonar-web/src/main/js/apps/documentation/styles.css

diff --git a/server/sonar-docs/src/images/check.svg b/server/sonar-docs/src/images/check.svg
new file mode 100644 (file)
index 0000000..51435de
--- /dev/null
@@ -0,0 +1 @@
+<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path d="M12.703 6.523a.593.593 0 0 0-.164-.419l-.83-.82a.58.58 0 0 0-.41-.173.58.58 0 0 0-.41.173l-3.718 3.71-2.06-2.06a.58.58 0 0 0-.41-.174.58.58 0 0 0-.41.174l-.83.82a.593.593 0 0 0-.164.42c0 .154.055.3.164.41l3.3 3.299c.109.11.264.173.41.173.155 0 .31-.064.419-.173l4.95-4.95a.571.571 0 0 0 .163-.41zM15 8c0 3.865-3.135 7-7 7s-7-3.135-7-7 3.135-7 7-7 7 3.135 7 7z" fill="#0a0" fill-rule="nonzero"/></svg>
diff --git a/server/sonar-docs/src/images/cross.svg b/server/sonar-docs/src/images/cross.svg
new file mode 100644 (file)
index 0000000..57c6853
--- /dev/null
@@ -0,0 +1 @@
+<svg width="16" height="16"  viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path d="M11.473 10.06a.58.58 0 0 0-.174-.41L9.65 8l1.65-1.65a.58.58 0 0 0 0-.83l-.82-.82a.58.58 0 0 0-.83 0L8 6.35 6.35 4.7a.58.58 0 0 0-.83 0l-.82.82a.58.58 0 0 0 0 .83L6.35 8 4.7 9.65a.58.58 0 0 0 0 .83l.82.82c.11.109.265.173.42.173a.58.58 0 0 0 .41-.174L8 9.65l1.65 1.65a.58.58 0 0 0 .83 0l.82-.82a.601.601 0 0 0 .173-.42zM15 8c0 3.865-3.135 7-7 7s-7-3.135-7-7 3.135-7 7-7 7 3.135 7 7z" fill="#d4333f" fill-rule="nonzero"/></svg>
diff --git a/server/sonar-docs/src/images/exclamation.svg b/server/sonar-docs/src/images/exclamation.svg
new file mode 100644 (file)
index 0000000..7b1e8da
--- /dev/null
@@ -0,0 +1 @@
+<svg width="16" height="16"  viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path d="M9.006 11.114V9.651a.25.25 0 0 0-.247-.254H7.281a.25.25 0 0 0-.247.254v1.463a.25.25 0 0 0 .247.254h1.478a.25.25 0 0 0 .247-.254zm-.016-2.88l.14-3.535a.186.186 0 0 0-.078-.147c-.046-.038-.115-.084-.185-.084H7.173c-.07 0-.139.046-.185.084-.054.039-.077.116-.077.162l.13 3.52c0 .1.116.177.263.177h1.425c.138 0 .254-.077.261-.177zM8.883 1.04l5.915 10.844a.986.986 0 0 1-.863 1.456H2.105a.986.986 0 0 1-.863-1.456L7.157 1.04a.98.98 0 0 1 1.726 0z" fill="#ff9900" fill-rule="nonzero"/></svg>
diff --git a/server/sonar-docs/src/images/info.svg b/server/sonar-docs/src/images/info.svg
new file mode 100644 (file)
index 0000000..c794429
--- /dev/null
@@ -0,0 +1 @@
+<svg width="16" height="16"  viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path d="M10.333 12.375v-1.458a.288.288 0 0 0-.291-.292h-.875V5.958a.288.288 0 0 0-.292-.291H5.958a.288.288 0 0 0-.291.291v1.459c0 .164.127.291.291.291h.875v2.917h-.875a.288.288 0 0 0-.291.292v1.458c0 .164.127.292.291.292h4.084a.288.288 0 0 0 .291-.292zM9.167 4.208V2.75a.288.288 0 0 0-.292-.292h-1.75a.288.288 0 0 0-.292.292v1.458c0 .164.128.292.292.292h1.75a.288.288 0 0 0 .292-.292zM15 8c0 3.865-3.135 7-7 7s-7-3.135-7-7 3.135-7 7-7 7 3.135 7 7z" fill="#4b9fd5" fill-rule="nonzero"/></svg>
index 37edc9dbc7750aa46b83d50d2957607e0893e953..2b673ee2181f03f5fda97e993826017001e0ea7b 100644 (file)
@@ -42,7 +42,16 @@ export default ({ data }) => {
     <div css={{ paddingTop: 24, paddingBottom: 24 }}>
       <Helmet title={page.frontmatter.title} />
       <h1>{page.frontmatter.title}</h1>
-      <div dangerouslySetInnerHTML={{ __html: htmlWithInclusions }} />
+      <div
+        css={{
+          '& img[src$=".svg"]': {
+            position: 'relative',
+            top: '-2px',
+            verticalAlign: 'text-bottom'
+          }
+        }}
+        dangerouslySetInnerHTML={{ __html: htmlWithInclusions }}
+      />
     </div>
   );
 };
index 65a0053399084a9b4d448392dd9bed3accc8aac6..9bc318b209b522a574badebe6898d06e6e4c7c18 100644 (file)
@@ -72,3 +72,7 @@
 .documentation-content.markdown li > p + ol {
   margin: 0;
 }
+
+.documentation-content.markdown img[src$='.svg'] {
+  vertical-align: text-bottom;
+}