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

CSS-like aliases for style attributes #1819

Open
dunkelziffer opened this issue Jan 28, 2024 · 1 comment
Open

CSS-like aliases for style attributes #1819

dunkelziffer opened this issue Jan 28, 2024 · 1 comment

Comments

@dunkelziffer
Copy link

Maybe this is just my perception as a web developer, but CSS seems to be the most ubiquitious design system. I know the default output format for D2 is SVG, so taking over some names from SVG attributes makes sense, but I think having aliases to CSS attributes would reduce the need to consult the docs as frequently for many people.

Suggested aliases:

current name alias
stroke border-color
stroke-width border-width
stroke-dash border-style
fill background-color
fill-pattern background-pattern (doesn't exist in CSS)
font font-family
font-color color
bold font-weight: bold
italic font-style: italic
underline text-decoration: underline

Some mappings are not perfect, e.g. bold/italic/underline. Maintaining this might not be worth the effort. I consider this a minor UX improvement.

@cyborg-ts cyborg-ts added this to D2 Jan 28, 2024
@abusizhishen
Copy link

Maybe this is just my perception as a web developer, but CSS seems to be the most ubiquitious design system. I know the default output format for D2 is SVG, so taking over some names from SVG attributes makes sense, but I think having aliases to CSS attributes would reduce the need to consult the docs as frequently for many people.

Suggested aliases:

current name alias
stroke border-color
stroke-width border-width
stroke-dash border-style
fill background-color
fill-pattern background-pattern (doesn't exist in CSS)
font font-family
font-color color
bold font-weight: bold
italic font-style: italic
underline text-decoration: underline
Some mappings are not perfect, e.g. bold/italic/underline. Maintaining this might not be worth the effort. I consider this a minor UX improvement.

thanks a lot, i have trouble in change container color, now it resolved

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

No branches or pull requests

2 participants