cli: Document -dark-theme gotcha

Updates #831
This commit is contained in:
Anmol Sethi 2023-02-25 10:39:21 -08:00
parent a2503328a2
commit 06548f1543
No known key found for this signature in database
GPG key ID: 25BC68888A99A8BA
2 changed files with 7 additions and 4 deletions

View file

@ -67,9 +67,12 @@ Port listening address when used with
Set the diagram theme ID Set the diagram theme ID
.Ns . .Ns .
.It Fl -dark-theme Ar -1 .It Fl -dark-theme Ar -1
Set the diagram dark theme ID. If unset, the The theme to use when the viewer's browser is in dark mode. When left unset
.Ar theme .Fl -theme
is used for both light and dark modes is used for both light and dark mode. Be aware that explicit styles set in D2 code will
still be applied and this may produce unexpected results. We plan on resolving this by
making style maps in D2 light/dark mode specific. See
.Lk https://github.com/terrastruct/d2/issues/831
.Ns . .Ns .
.It Fl s , -sketch Ar false .It Fl s , -sketch Ar false
Renders the diagram to look like it was sketched by hand Renders the diagram to look like it was sketched by hand

View file

@ -69,7 +69,7 @@ func run(ctx context.Context, ms *xmain.State) (err error) {
if err != nil { if err != nil {
return err return err
} }
darkThemeFlag, err := ms.Opts.Int64("D2_DARK_THEME", "dark-theme", "", -1, "the diagram dark theme ID. When left unset only the theme will be applied") darkThemeFlag, err := ms.Opts.Int64("D2_DARK_THEME", "dark-theme", "", -1, "The theme to use when the viewer's browser is in dark mode. When left unset -theme is used for both light and dark mode. Be aware that explicit styles set in D2 code will still be applied and this may produce unexpected results. We plan on resolving this by making style maps in D2 light/dark mode specific. See https://github.com/terrastruct/d2/issues/831.")
if err != nil { if err != nil {
return err return err
} }