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

Ability to set custom CSS, move style declaration to classes #390

Open
wants to merge 5 commits into
base: trunk
Choose a base branch
from

Conversation

adrienkohlbecker
Copy link
Contributor

Hi!

I recently wanted to customize the styling of some of the elements in my diagrams. To do so, I needed to add custom CSS declarations to the output. This PR adds a config.customStyle property to do so. If it is set, a <style type="text/css">property value</style> block is appended to the body.

Additionally, overriding some of the default styles was made complicated by the use of inline styles. Indeed, CSS specificity rules dictate that inline styles have priority, unless you use !important everywhere. So, to make it easier, I added classes on a few elements and moved inline styles to the main style block for each skin.

@adrienkohlbecker
Copy link
Contributor Author

adrienkohlbecker commented Jul 31, 2023

Eslint is reporting whitespace issues with code not related to this PR. I have fixed them anyway!

@Ganesh-AT
Copy link

@adrienkohlbecker While attempting to port in some of the updates in this PR into my fork, I found references to two new classes in render-wave-lane.js:

The lane_label in class: 'info lane_label' is intuitively named.

However, I would suggest class: data_label as a more suitable alternative to the proposed class: lane_marker earlier in that file. It would also make things consistent with other custom class names such as group_label in another file.

What is your opinion?

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.

None yet

2 participants