Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config vars #1475

Closed
alixander opened this issue Jul 12, 2023 · 2 comments · Fixed by #1481
Closed

config vars #1475

alixander opened this issue Jul 12, 2023 · 2 comments · Fixed by #1481

Comments

@alixander
Copy link
Collaborator

  • d2-config variables should be secondary to CLI flags and env vars, but used if not defined anywhere else
  • theme-colors is an advanced feature that lets you override any theme variables, and can be used to design your own theme
vars: {
  d2-config: {
    theme: 123
    dark-theme: 123
    layout: elk
    sketch: false
    pad: 0
    theme-colors: {
      N1: "#FFF"
    }
  }
}
@soma-m
Copy link

soma-m commented Jul 12, 2023

Does this mean, we can have the config in a separate D2 file and import it into other files that contain only business logic?

@alixander
Copy link
Collaborator Author

yes.

configs.d2

theme: 123
dark-theme: 211

main.d2

vars: {
  d2-config: @configs
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants