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

control padding more #1740

Open
alixander opened this issue Nov 21, 2023 · 5 comments
Open

control padding more #1740

alixander opened this issue Nov 21, 2023 · 5 comments

Comments

@alixander
Copy link
Collaborator

alixander commented Nov 21, 2023

e.g. a common use case is container around image. but padding makes it too big

another use case for gap-size? (#1738)

@cyborg-ts cyborg-ts added this to D2 Nov 21, 2023
@alixander
Copy link
Collaborator Author

Screen Shot 2023-11-23 at 8 22 20 AM

@alixander
Copy link
Collaborator Author

Screenshot 2024-01-31 at 8 14 15 PM

@bo-ku-ra
Copy link
Contributor

bo-ku-ra commented Feb 2, 2024

its not impossible.

grid-columns: 3
grid-gap: 0
c1: "" {
  style.opacity: 0
  grid-rows: 3
  grid-gap: 0

  l1: "" {
    style.opacity: 0
    grid-rows: 1
    grid-gap: 0
    a
    s1: {width: 10; style.opacity: 0}
    b
    s2: {width: 10; style.opacity: 0}
    c
  }
  s3: {height: 10; style.opacity: 0}
  d
}
s4: {width: 10; style.opacity: 0}
e

***: {style.border-radius: 10}

@Jasper-Li
Copy link

Jasper-Li commented Feb 3, 2024

its not impossible.

grid-columns: 3
grid-gap: 0
c1: "" {
  style.opacity: 0
  grid-rows: 3
  grid-gap: 0

  l1: "" {
    style.opacity: 0
    grid-rows: 1
    grid-gap: 0
    a
    s1: {width: 10; style.opacity: 0}
    b
    s2: {width: 10; style.opacity: 0}
    c
  }
  s3: {height: 10; style.opacity: 0}
  d
}
s4: {width: 10; style.opacity: 0}
e

***: {style.border-radius: 10}

Great! Achive it by 2 steps:

  1. Make grid-gap: 0
  2. Make spacer unvisible.
    image

@bo-ku-ra
Copy link
Contributor

bo-ku-ra commented Feb 3, 2024

Screen Shot 2023-11-23 at 8 22 20 AM

cf.

z{
x->y
***{width:1; height:1}
}

>d2.exe --dagre-nodesep 0 --dagre-edgesep 0
image

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

3 participants