Skip to content

Adds font-color and border-radius to D2Style#34

Open
cmotta wants to merge 1 commit into
MrBlenny:mainfrom
cmotta:adds-shape-style-attributes
Open

Adds font-color and border-radius to D2Style#34
cmotta wants to merge 1 commit into
MrBlenny:mainfrom
cmotta:adds-shape-style-attributes

Conversation

@cmotta

@cmotta cmotta commented Feb 9, 2025

Copy link
Copy Markdown

This pull request adds support for font-color and border-radius within the D2Style class. These additions allow users to further customize the appearance of their diagrams by controlling the font color and border radius of elements.

Changes:

  • Added font_color (Optional[str]) and border_radius (Optional[str]) parameters to the D2Style constructor.
  • Included tests for both attributes and added them to the all styles test

Example Usage:

from py_d2.style import D2Style

style = D2Style(
    stroke="#0000FF",
    fill="#ADD8E6",
    font_color="red",  # New
    border_radius="10" # New
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant