Skip to content

bug: no arrows on dark theme #26

@adrianopol

Description

@adrianopol

Hello! When I am using dark theme for both d2 and mkdocs, arrows are not visible at all:

Image

mkdocs.yaml:

site_name: My Docs
theme:
  name: material
  palette:
    scheme: slate
plugins:
  - d2:
      dark_theme: 200

docs/index.md:

# Welcome

```d2
direction: right

A -> B
```

If I comment theme section in mkdocs.yaml, arrow becomes visible, but it is blue as on light d2 theme:

Image

When file is generated by d2 externally and included, arrow is correct:

$ cat > d.d2
direction: right

A -> B

$ d2 --dark-theme 200 docs/d.d2 
success: successfully compiled docs/d.d2 to docs/d.svg in 40.044975ms

docs/index.md:

# Welcome

![](d.svg)
$ mkdocs build
INFO    -  mkdocs-d2-plugin: Using cache at .cache/plugin/d2/db (None)
INFO    -  Cleaning site directory
INFO    -  Building documentation to directory: /.../site
INFO    -  Documentation built in 0.23 seconds

Image

$ d2 --version
v0.6.8

$ mkdocs --version
mkdocs, version 1.6.1 from /nix/store/07c3rjrbnffp130ibwkq2y7fzprc1k8q-python3-3.12.9-env/lib/python3.12/site-packages/mkdocs (Python 3.12)

shell.nix:

...
  nativeBuildInputs = [
    (
      let
        my_py_pkgs =
          p: with p; [
            mkdocs
            mkdocs-material
            pymdown-extensions

            (buildPythonPackage rec {
              pname = "mkdocs_d2_plugin";
              version = "1.6.0";
              src = fetchPypi {
                inherit pname version;
                hash = "sha256-QsHy3C7p+omMYg4BHyJt4NkKtM0mQFYBmdf5GViaWRs=";
              };
              dependencies = [
                mkdocs
                pydantic
                pymdown-extensions
              ];
              doCheck = true;
            })
          ];
      in
      unstable.python3.withPackages my_py_pkgs
    )
  ];

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions