How can I style all children activities within a partition in an Activity diagram?

0 votes
asked Jul 22, 2025 in Question / help by yesterdayforgotten (120 points)

I'd like to be able to style all the children elements/activities under a specific partition while leaving those activities outside of the partition alone. I've tried the following but it doesn't end up selecting anything and has no effect. Is there another way to accomplish this without specifically tagging each activity I want to modify?

@startuml
<style>
partition {
  activity {
    BackgroundColor: blue;
  }
}
</style>

start
partition "Partition1" {
  :Activity1;
  :Activity2;
}
:Activity3;
@enduml

2 Answers

0 votes
answered Jul 24, 2025 by The-Lu (87,240 points)

Hi Y.,

Currently not possible, I just open this wanted feature here:

Then here is a workaround, as you mention, by "tagging specifically each activity":

@startuml
<style>
.mystyle {
    BackgroundColor: blue;
}
</style>

start
:Activity0;
partition "Partition1" {
  :Activity1; <<mystyle>>
  :Activity2; <<mystyle>>
}

:Activity3;

@enduml

Enjoy,
Regards,
Th.

0 votes
answered Sep 11, 2025 by The-Lu (87,240 points)

Hi Y.,

Here is another workaround (since v1.2025.5):

@startuml
start
:Activity0;
partition "Partition1" {
<style>
  activity {
    BackgroundColor: blue;
}
</style>
  :Activity1;
  :Activity2;
}

<style>
  activity {
    BackgroundColor: #f1f1f1;
}
</style>
:Activity3;
@enduml

See:

Enjoy,
Regards,
Th.

...