From e20528ab0df15d1b254fc9c10aa955b9928b6aa6 Mon Sep 17 00:00:00 2001 From: Tyler Long Date: Sun, 11 Mar 2018 18:06:28 +0800 Subject: [PATCH] Simplify scss code --- src/mermaidAPI.js | 8 +++---- .../dark/{variables.scss => index.scss} | 2 ++ src/themes/dark/mermaid.scss | 24 ------------------- .../default/{variables.scss => index.scss} | 2 ++ src/themes/default/mermaid.scss | 23 ------------------ .../forest/{variables.scss => index.scss} | 2 ++ src/themes/{forest => }/mermaid.scss | 11 +++++---- .../neutral/{variables.scss => index.scss} | 2 ++ src/themes/neutral/mermaid.scss | 23 ------------------ src/themes/sequenceDiagram.scss | 10 ++++---- 10 files changed, 23 insertions(+), 84 deletions(-) rename src/themes/dark/{variables.scss => index.scss} (98%) delete mode 100644 src/themes/dark/mermaid.scss rename src/themes/default/{variables.scss => index.scss} (98%) delete mode 100644 src/themes/default/mermaid.scss rename src/themes/forest/{variables.scss => index.scss} (98%) rename src/themes/{forest => }/mermaid.scss (75%) rename src/themes/neutral/{variables.scss => index.scss} (98%) delete mode 100644 src/themes/neutral/mermaid.scss diff --git a/src/mermaidAPI.js b/src/mermaidAPI.js index cf57c2c32..1176be0e7 100644 --- a/src/mermaidAPI.js +++ b/src/mermaidAPI.js @@ -36,10 +36,10 @@ import gitGraphRenderer from './diagrams/gitGraph/gitGraphRenderer' import gitGraphAst from './diagrams/gitGraph/gitGraphAst' import pkg from '../package.json' -import darkTheme from './themes/dark/mermaid.scss' -import defaultTheme from './themes/default/mermaid.scss' -import forestTheme from './themes/forest/mermaid.scss' -import neutralTheme from './themes/neutral/mermaid.scss' +import darkTheme from './themes/dark/index.scss' +import defaultTheme from './themes/default/index.scss' +import forestTheme from './themes/forest/index.scss' +import neutralTheme from './themes/neutral/index.scss' const themes = { dark: darkTheme, diff --git a/src/themes/dark/variables.scss b/src/themes/dark/index.scss similarity index 98% rename from src/themes/dark/variables.scss rename to src/themes/dark/index.scss index ab6b2977c..529eb3f70 100644 --- a/src/themes/dark/variables.scss +++ b/src/themes/dark/index.scss @@ -50,3 +50,5 @@ $critBorderColor: #E83737; $critBkgColor: #E83737; $taskTextDarkColor: $darkTextColor; $todayLineColor: #DB5757; + +@import '../mermaid'; diff --git a/src/themes/dark/mermaid.scss b/src/themes/dark/mermaid.scss deleted file mode 100644 index 0fdf6b3db..000000000 --- a/src/themes/dark/mermaid.scss +++ /dev/null @@ -1,24 +0,0 @@ -@import "variables"; -@import "../flow"; -@import "../sequenceDiagram"; -@import "../gantt"; -@import "../classDiagram"; -@import "../gitGraph"; -.node text { - font-family: 'trebuchet ms', verdana, arial; - font-size: 14px; -} - -div.mermaidTooltip { - position: absolute; - text-align: center; - max-width: 200px; - padding: 2px; - font-family: 'trebuchet ms', verdana, arial; - font-size: 12px; - background: $secondBkg; - border: 1px solid $border2; - border-radius: 2px; - pointer-events: none; - z-index: 100; -} diff --git a/src/themes/default/variables.scss b/src/themes/default/index.scss similarity index 98% rename from src/themes/default/variables.scss rename to src/themes/default/index.scss index 02e46e1b0..e98fc0741 100644 --- a/src/themes/default/variables.scss +++ b/src/themes/default/index.scss @@ -48,3 +48,5 @@ $doneTaskBorderColor: grey; $critBorderColor: #ff8888; $critBkgColor: red; $todayLineColor: red; + +@import '../mermaid'; diff --git a/src/themes/default/mermaid.scss b/src/themes/default/mermaid.scss deleted file mode 100644 index 544003e93..000000000 --- a/src/themes/default/mermaid.scss +++ /dev/null @@ -1,23 +0,0 @@ -@import "variables"; -@import "../flow"; -@import "../sequenceDiagram"; -@import "../gantt"; -@import "../classDiagram"; -.node text { - font-family: 'trebuchet ms', verdana, arial; - font-size: 14px; -} - -div.mermaidTooltip { - position: absolute; - text-align: center; - max-width: 200px; - padding: 2px; - font-family: 'trebuchet ms', verdana, arial; - font-size: 12px; - background: $secondBkg; - border: 1px solid $border2; - border-radius: 2px; - pointer-events: none; - z-index: 100; -} diff --git a/src/themes/forest/variables.scss b/src/themes/forest/index.scss similarity index 98% rename from src/themes/forest/variables.scss rename to src/themes/forest/index.scss index e6c700b86..456cc661c 100644 --- a/src/themes/forest/variables.scss +++ b/src/themes/forest/index.scss @@ -50,3 +50,5 @@ $doneTaskBorderColor: grey; $critBorderColor: #ff8888; $critBkgColor: red; $todayLineColor: red; + +@import '../mermaid'; diff --git a/src/themes/forest/mermaid.scss b/src/themes/mermaid.scss similarity index 75% rename from src/themes/forest/mermaid.scss rename to src/themes/mermaid.scss index 544003e93..df7d3026d 100644 --- a/src/themes/forest/mermaid.scss +++ b/src/themes/mermaid.scss @@ -1,8 +1,9 @@ -@import "variables"; -@import "../flow"; -@import "../sequenceDiagram"; -@import "../gantt"; -@import "../classDiagram"; +@import 'flow'; +@import 'sequenceDiagram'; +@import 'gantt'; +@import 'classDiagram'; +@import 'gitGraph'; + .node text { font-family: 'trebuchet ms', verdana, arial; font-size: 14px; diff --git a/src/themes/neutral/variables.scss b/src/themes/neutral/index.scss similarity index 98% rename from src/themes/neutral/variables.scss rename to src/themes/neutral/index.scss index 1dc9c2c56..f0560142f 100644 --- a/src/themes/neutral/variables.scss +++ b/src/themes/neutral/index.scss @@ -53,3 +53,5 @@ $doneTaskBorderColor: $lineColor; $critBkgColor: $critical; $critBorderColor: darken($critBkgColor, 10%); $todayLineColor: $critBkgColor; + +@import '../mermaid'; diff --git a/src/themes/neutral/mermaid.scss b/src/themes/neutral/mermaid.scss deleted file mode 100644 index b4facf5a4..000000000 --- a/src/themes/neutral/mermaid.scss +++ /dev/null @@ -1,23 +0,0 @@ -@import "variables"; -@import "../flow"; -@import "../sequenceDiagram"; -@import "../gantt"; -@import "../classDiagram"; -.node text { - font-family: Arial, Helvetica, sans-serif; - font-size: 14px; -} - -div.mermaidTooltip { - position: absolute; - text-align: center; - max-width: 200px; - padding: 2px; - font-family: Arial, Helvetica, sans-serif; - font-size: 12px; - background: $secondBkg; - border: 1px solid $border2; - border-radius: 2px; - pointer-events: none; - z-index: 100; -} diff --git a/src/themes/sequenceDiagram.scss b/src/themes/sequenceDiagram.scss index 3d436c0a3..780e8ecf5 100644 --- a/src/themes/sequenceDiagram.scss +++ b/src/themes/sequenceDiagram.scss @@ -14,14 +14,14 @@ text.actor { .messageLine0 { stroke-width: 1.5; - stroke-dasharray: "2 2"; - marker-end: "url(#arrowhead)"; + stroke-dasharray: '2 2'; + marker-end: 'url(#arrowhead)'; stroke: $signalColor; } .messageLine1 { stroke-width: 1.5; - stroke-dasharray: "2 2"; + stroke-dasharray: '2 2'; stroke: $signalColor; } @@ -56,8 +56,8 @@ text.actor { .loopLine { stroke-width: 2; - stroke-dasharray: "2 2"; - marker-end: "url(#arrowhead)"; + stroke-dasharray: '2 2'; + marker-end: 'url(#arrowhead)'; stroke: $labelBoxBorderColor; }