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

Compound node padding style not working as expected #3224

Closed
KasperAanstoot opened this issue Feb 26, 2024 · 4 comments
Closed

Compound node padding style not working as expected #3224

KasperAanstoot opened this issue Feb 26, 2024 · 4 comments

Comments

@KasperAanstoot
Copy link

Environment info

  • Cytoscape.js version : 3.28.1
  • Browser version : Chrome 121.0.6167.185 (Official Build) (64-bit)

Current (buggy) behaviour

In my stylesheet I use the following rules for a compound node (selector: $node > node):
'padding-top': '20px',
'padding-left': '5px',
'padding-right': '5px',
'padding-bottom': '5px',

The result is a padding of '5px' for top, left, right and bottom.

Desired behaviour

Set the the padding for top to '20px' and the others to '5px' according to the stylesheet.

Minimum steps to reproduce

https://jsbin.com/bisocidilu/1/edit?html,css,js,output

@KasperAanstoot KasperAanstoot added the bug A bug in the code of Cytoscape.js label Feb 26, 2024
@maxkfranz maxkfranz removed the bug A bug in the code of Cytoscape.js label Feb 27, 2024
@maxkfranz
Copy link
Member

The documentation shows only one padding property for all sides, here: https://js.cytoscape.org/#style/node-body

Where did you see a reference to multiple properties?

@KasperAanstoot
Copy link
Author

Eles.style() shows multiple properties so I thought it would be possible to set them in the stylesheet. I also tried setting padding to "20px, 5px, 5px, 5px" :-)

@maxkfranz
Copy link
Member

Then someone made a mistake in the community-maintained type definitions on DefinitelyTyped.

You're welcome to put up a pull request on DefinitelyTyped if you'd like to revise it.

@maxkfranz
Copy link
Member

See also #3166

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

No branches or pull requests

2 participants