In PlantUML you can style all classes like this:
@startuml
<style>
classDiagram {
class {
FontColor blue
BackgroundColor yellow
header {
FontSize 20
FontColor violet
FontStyle bold
}
}
}
</style>
abstract abstract
abstract class "abstract class"
annotation annotation
class class
class class_stereo <<stereotype>>
entity entity
enum enum
exception exception
interface interface
metaclass metaclass
protocol protocol
stereotype stereotype
struct struct
@enduml
This applies to all "classes", meaning not only the class, but annotation, entity etc. as well.
Is there a way to style the "classes" individually, e.g. only adjust interface, but leave the other styles as they are?
You can define and use custom styles like this:
@startuml
<style>
classDiagram {
class {
.style1 {
FontColor blue
BackgroundColor yellow
header {
FontSize 20
FontColor violet
FontStyle bold
}
}
.style2 {
BackgroundColor lightblue
}
}
}
</style>
hide <<style1>> stereotype
hide <<style2>> stereotype
' hide circle
class C0 {
}
interface C1 <<style1>> {
}
class C2 <<style2>> {
}
@enduml
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With