-
Notifications
You must be signed in to change notification settings - Fork 226
Added "Classes" that is then consumed by LinkWidget to make custom links possible. #478
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
base: develop
Are you sure you want to change the base?
Conversation
Hey, please see my comment on the other PR, I'd like your opinion as well! |
Its a bit more complicated to use but it the end it does provide the same functionality so why not! Good job |
Classes like that are not a good option. It's better to remove all inline styles and replace them with CSS classes. I chose to create some classes and override the behaviors. Here’s my basic example: .diagram-link {
|
I propose replacing all inline styles with a global CSS file that contains everything. This simplifies and makes customizations easier. |
I'm not sure what you mean. There are no inline styles here. This adds a parameter called Class that lets you set your own classes on the component. This is how it's done in nearly all modern component libraries. |
This example changes the style of all links. This PR solves the issue of being able to style multiple links differently. |
My proposal is to change the current behavior and allow default styles to be modified globally. As for using classes, you’re right—that’s a good idea. It will allow styling links individually. |
A class is needed for the normal state and another for the selected state. This way, it is complete. |
No, that would not solve the problem. |
Reviewing the examples, if I understand correctly, what you want can already be done. In the "Lots of features" example on the Blazor.Diagrams site, you can see several links with different styles. |
No, it is only possible to change color at the moment, by using the "Color" parameter. It Is not possible to target specific links with CSS without my PR. |
While i do prefer the other solution, this one avoids the usage of BaseLinkModel in favour of LinkModel.
Since we already accept "Color" in LinkModel, "Classes" should be fine here too.
Using CSS ":has" you are also able to target the
<g>
tag in this way if you want to:This PR is in response to this one: #386