How to change thickness of an arrow using <style>

0 votes
asked Oct 2, 2021 in Question / help by dannief (140 points)

This works


@startuml
rectangle one <<one>> as "ONE"
rectangle two <<two>> as "TWO"

one -[thickness=8]>> two
@enduml

However as soon as I add style tags, the default style of the diagram changes and I lose the thickness of the arrow. But I don't know how to specify arrow thickness using the style tag


@startuml
<style>
{
}
</style>

rectangle one <<one>> as "ONE"
rectangle two <<two>> as "TWO"

one -[thickness=8]>> two
@enduml


1 Answer

0 votes
answered Oct 2, 2021 by The-Lu (46,280 points)

Hello D.,

For that you can use (but it is global and not local...):

@startuml
<style>
arrow {
  LineThickness 9
}
</style>

rectangle one <<one>> as "ONE"
rectangle two <<two>> as "TWO"

one ->> two
@enduml

See also doc. on style here:

If that can help,
Regards,
Th.

commented Oct 4, 2021 by dannief (140 points)
edited Oct 4, 2021 by dannief
Thank you. I was actually aware of this setting.

Is there a plan to allow individual arrows to be styled with the new CSS syntax? That is what I was trying to do
commented Mar 9 by The-Lu (46,280 points)

Hello D.,

Is there a plan to allow individual arrows to be styled with the new CSS syntax? That is what I was trying to do

With last version, we can now use stereotype style as:

@startuml
<style>
.big {
arrow {
  LineThickness 9
}
}
.red {
arrow {
  LineThickness 3
  Linecolor red
}
}
</style>

rectangle one as "ONE"
rectangle two as "TWO"
rectangle three as "THREE"

one ->> two <<big>>
two -> three <<red>>

@enduml

Enjoy...

...