Added CSS variables for Mermaid sequence diagrams (#5940)

* Add CSS variables for Mermaid sequence diagram note

* Add CSS variables for Mermaid sequence diagram actor

* Add CSS variables for Mermaid sequence diagram message

* Add CSS variables for Mermaid sequence diagram actor man

* Add CSS variables for Mermaid sequence diagram loop

* Add CSS variables for Mermaid sequence diagram number

* Add CSS variables for Mermaid sequence diagram box

---------

Co-authored-by: Martin Donath <martin.donath@squidfunk.com>
This commit is contained in:
Sigurd Spieckermann 2023-09-02 18:58:13 +02:00 committed by GitHub
parent ec709b4f0e
commit ea53f53982
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 98 additions and 21 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -44,7 +44,7 @@
{% endif %} {% endif %}
{% endblock %} {% endblock %}
{% block styles %} {% block styles %}
<link rel="stylesheet" href="{{ 'assets/stylesheets/main.f814a825.min.css' | url }}"> <link rel="stylesheet" href="{{ 'assets/stylesheets/main.8b05fc09.min.css' | url }}">
{% if config.theme.palette %} {% if config.theme.palette %}
{% set palette = config.theme.palette %} {% set palette = config.theme.palette %}
<link rel="stylesheet" href="{{ 'assets/stylesheets/palette.85d0ee34.min.css' | url }}"> <link rel="stylesheet" href="{{ 'assets/stylesheets/palette.85d0ee34.min.css' | url }}">
@ -250,7 +250,7 @@
</script> </script>
{% endblock %} {% endblock %}
{% block scripts %} {% block scripts %}
<script src="{{ 'assets/javascripts/bundle.315d0c11.min.js' | url }}"></script> <script src="{{ 'assets/javascripts/bundle.7084fa49.min.js' | url }}"></script>
{% for script in config.extra_javascript %} {% for script in config.extra_javascript %}
{{ script | script_tag }} {{ script | script_tag }}
{% endfor %} {% endfor %}

View File

@ -324,32 +324,38 @@ defs #ZERO_OR_MORE_END circle {
/* Sequence actor */ /* Sequence actor */
.actor { .actor {
fill: var(--md-mermaid-label-bg-color); fill: var(--md-mermaid-sequence-actor-bg-color);
stroke: var(--md-mermaid-node-fg-color); stroke: var(--md-mermaid-sequence-actor-border-color);
} }
/* Sequence actor text */ /* Sequence actor text */
text.actor > tspan { text.actor > tspan {
font-family: var(--md-mermaid-font-family); font-family: var(--md-mermaid-font-family);
fill: var(--md-mermaid-label-fg-color); fill: var(--md-mermaid-sequence-actor-fg-color);
} }
/* Sequence actor line */ /* Sequence actor line */
line { line {
stroke: var(--md-default-fg-color--lighter); stroke: var(--md-mermaid-sequence-actor-line-color);
} }
/* Sequence actor */ /* Sequence actor */
.actor-man circle, .actor-man circle,
.actor-man line { .actor-man line {
fill: var(--md-mermaid-label-bg-color); fill: var(--md-mermaid-sequence-actorman-bg-color);
stroke: var(--md-mermaid-node-fg-color); stroke: var(--md-mermaid-sequence-actorman-line-color);
} }
/* Sequence message line */ /* Sequence message line */
.messageLine0, .messageLine0,
.messageLine1 { .messageLine1 {
stroke: var(--md-mermaid-edge-color); stroke: var(--md-mermaid-sequence-message-line-color);
}
/* Sequence note */
.note {
fill: var(--md-mermaid-sequence-note-bg-color);
stroke: var(--md-mermaid-sequence-note-border-color);
} }
/* Sequence message, loop and note text */ /* Sequence message, loop and note text */
@ -358,30 +364,40 @@ line {
.loopText > tspan, .loopText > tspan,
.noteText > tspan { .noteText > tspan {
font-family: var(--md-mermaid-font-family) !important; font-family: var(--md-mermaid-font-family) !important;
fill: var(--md-mermaid-edge-color);
stroke: none; stroke: none;
} }
/* Sequence message text */
.messageText {
fill: var(--md-mermaid-sequence-message-fg-color);
}
/* Sequence loop text */
.loopText,
.loopText > tspan {
fill: var(--md-mermaid-sequence-loop-fg-color);
}
/* Sequence note text */ /* Sequence note text */
.noteText > tspan { .noteText > tspan {
fill: hsl(0, 0%, 0%); fill: var(--md-mermaid-sequence-note-fg-color);
} }
/* Sequence arrow head */ /* Sequence arrow head */
#arrowhead path { #arrowhead path {
fill: var(--md-mermaid-edge-color); fill: var(--md-mermaid-sequence-message-line-color);
stroke: none; stroke: none;
} }
/* Sequence loop line */ /* Sequence loop line */
.loopLine { .loopLine {
fill: var(--md-mermaid-node-bg-color); fill: var(--md-mermaid-sequence-loop-bg-color);
stroke: var(--md-mermaid-node-fg-color); stroke: var(--md-mermaid-sequence-loop-border-color);
} }
/* Sequence label box */ /* Sequence label box */
.labelBox { .labelBox {
fill: var(--md-mermaid-node-bg-color); fill: var(--md-mermaid-sequence-label-bg-color);
stroke: none; stroke: none;
} }
@ -389,26 +405,26 @@ line {
.labelText, .labelText,
.labelText > span { .labelText > span {
font-family: var(--md-mermaid-font-family); font-family: var(--md-mermaid-font-family);
fill: var(--md-mermaid-node-fg-color); fill: var(--md-mermaid-sequence-label-fg-color);
} }
/* Sequence number */ /* Sequence number */
.sequenceNumber { .sequenceNumber {
fill: var(--md-accent-bg-color); fill: var(--md-mermaid-sequence-number-fg-color);
} }
/* Sequence rectangle */ /* Sequence rectangle */
rect.rect { rect.rect {
fill: var(--md-mermaid-node-bg-color); fill: var(--md-mermaid-sequence-box-bg-color);
stroke: none; stroke: none;
} }
/* Sequence rectangle text */ /* Sequence rectangle text */
rect.rect + text.text { rect.rect + text.text {
fill: var(--md-mermaid-edge-color); fill: var(--md-mermaid-sequence-box-fg-color);
} }
/* Sequence diagram markers */ /* Sequence diagram markers */
defs #sequencenumber { defs #sequencenumber {
fill: var(--md-mermaid-node-fg-color) !important; fill: var(--md-mermaid-sequence-number-bg-color) !important;
} }

View File

@ -28,12 +28,34 @@
:root > * { :root > * {
--md-mermaid-font-family: var(--md-text-font-family), sans-serif; --md-mermaid-font-family: var(--md-text-font-family), sans-serif;
// Colors // General colors
--md-mermaid-edge-color: var(--md-code-fg-color); --md-mermaid-edge-color: var(--md-code-fg-color);
--md-mermaid-node-bg-color: var(--md-accent-fg-color--transparent); --md-mermaid-node-bg-color: var(--md-accent-fg-color--transparent);
--md-mermaid-node-fg-color: var(--md-accent-fg-color); --md-mermaid-node-fg-color: var(--md-accent-fg-color);
--md-mermaid-label-bg-color: var(--md-default-bg-color); --md-mermaid-label-bg-color: var(--md-default-bg-color);
--md-mermaid-label-fg-color: var(--md-code-fg-color); --md-mermaid-label-fg-color: var(--md-code-fg-color);
// Sequence diagram colors
--md-mermaid-sequence-actor-bg-color: var(--md-mermaid-label-bg-color);
--md-mermaid-sequence-actor-fg-color: var(--md-mermaid-label-fg-color);
--md-mermaid-sequence-actor-border-color: var(--md-mermaid-node-fg-color);
--md-mermaid-sequence-actor-line-color: var(--md-default-fg-color--lighter);
--md-mermaid-sequence-actorman-bg-color: var(--md-mermaid-label-bg-color);
--md-mermaid-sequence-actorman-line-color: var(--md-mermaid-node-fg-color);
--md-mermaid-sequence-box-bg-color: var(--md-mermaid-node-bg-color);
--md-mermaid-sequence-box-fg-color: var(--md-mermaid-edge-color);
--md-mermaid-sequence-label-bg-color: var(--md-mermaid-node-bg-color);
--md-mermaid-sequence-label-fg-color: var(--md-mermaid-node-fg-color);
--md-mermaid-sequence-loop-bg-color: var(--md-mermaid-node-bg-color);
--md-mermaid-sequence-loop-fg-color: var(--md-mermaid-edge-color);
--md-mermaid-sequence-loop-border-color: var(--md-mermaid-node-fg-color);
--md-mermaid-sequence-message-fg-color: var(--md-mermaid-edge-color);
--md-mermaid-sequence-message-line-color: var(--md-mermaid-edge-color);
--md-mermaid-sequence-note-bg-color: var(--md-mermaid-label-bg-color);
--md-mermaid-sequence-note-fg-color: var(--md-mermaid-edge-color);
--md-mermaid-sequence-note-border-color: var(--md-mermaid-label-fg-color);
--md-mermaid-sequence-number-bg-color: var(--md-mermaid-node-fg-color);
--md-mermaid-sequence-number-fg-color: var(--md-accent-bg-color);
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------