diff --git a/webapp/src/app/shared/ui/legend-tooltip/legend-tooltip.component.html b/webapp/src/app/shared/ui/legend-tooltip/legend-tooltip.component.html
new file mode 100644
index 00000000..2ed8354f
--- /dev/null
+++ b/webapp/src/app/shared/ui/legend-tooltip/legend-tooltip.component.html
@@ -0,0 +1,10 @@
+
diff --git a/webapp/src/app/shared/ui/legend-tooltip/legend-tooltip.component.scss b/webapp/src/app/shared/ui/legend-tooltip/legend-tooltip.component.scss
new file mode 100644
index 00000000..a6ab156e
--- /dev/null
+++ b/webapp/src/app/shared/ui/legend-tooltip/legend-tooltip.component.scss
@@ -0,0 +1,46 @@
+:host {
+ --topic-border: color-mix(
+ in srgb,
+ hsl(var(--topic-color)) 72%,
+ var(--sg-color-mix-base)
+ );
+ --topic-background: color-mix(
+ in srgb,
+ hsl(var(--topic-color)) 8%,
+ var(--sg-color-mix-base)
+ );
+}
+
+.legend-tooltip-card {
+ display: flex;
+ flex-direction: column;
+ gap: 0.5rem;
+ padding: 1rem;
+ border-radius: var(--sg-radius-sm);
+ background-color: var(--topic-background);
+ border: 1px solid var(--topic-border);
+ color: var(--sg-text);
+}
+
+.legend-tooltip-title {
+ font-weight: 600;
+ font-size: 1rem;
+}
+
+.legend-tooltip-hierarchy {
+ color: var(--sg-text-muted);
+ font-size: 0.875rem;
+}
+
+.legend-tooltip-divider {
+ margin: 0;
+ border: none;
+ border-top: 1px solid var(--topic-border);
+}
+
+.legend-tooltip-description {
+ margin: 0;
+ color: var(--sg-text);
+ font-size: 0.875rem;
+ line-height: 1.4;
+}
diff --git a/webapp/src/app/shared/ui/legend-tooltip/legend-tooltip.component.ts b/webapp/src/app/shared/ui/legend-tooltip/legend-tooltip.component.ts
new file mode 100644
index 00000000..76390e98
--- /dev/null
+++ b/webapp/src/app/shared/ui/legend-tooltip/legend-tooltip.component.ts
@@ -0,0 +1,23 @@
+import { Component, computed, input } from '@angular/core';
+
+@Component({
+ host: {
+ '[style.--topic-color]': 'topicColorVar()',
+ },
+ selector: 'app-legend-tooltip',
+ standalone: true,
+ templateUrl: './legend-tooltip.component.html',
+ styleUrl: './legend-tooltip.component.scss',
+})
+export class LegendTooltipComponent {
+ readonly name = input.required();
+ readonly hierarchy = input(null);
+ readonly description = input(null);
+ readonly color = input(null);
+
+ readonly topicColorVar = computed(() => {
+ const color = this.color();
+ if (!color) return '';
+ return color.replace('hsl(', '').replace(')', '');
+ });
+}
diff --git a/webapp/src/app/shared/ui/topic-legend/topic-legend.component.html b/webapp/src/app/shared/ui/topic-legend/topic-legend.component.html
index 330ccc2b..d86fe307 100644
--- a/webapp/src/app/shared/ui/topic-legend/topic-legend.component.html
+++ b/webapp/src/app/shared/ui/topic-legend/topic-legend.component.html
@@ -54,10 +54,15 @@
class="topic-legend-field"
[class.topic-legend-entry-active]="isFieldActive(group)"
[attr.aria-pressed]="selectable ? isFieldActive(group) : null"
- [matTooltip]="group.tooltip"
- [matTooltipDisabled]="!group.tooltip"
- matTooltipClass="topic-chip-tooltip"
- matTooltipPosition="above"
+ [appComponentTooltip]="LegendTooltipComponent"
+ [tooltipInputs]="{
+ name: group.name,
+ hierarchy: group.domainName,
+ description: group.description,
+ color: group.color,
+ }"
+ [tooltipDisabled]="!group.description"
+ [tooltipMaxWidth]="'420px'"
(click)="toggleField(group)">
{{ item.name }}
diff --git a/webapp/src/app/shared/ui/topic-legend/topic-legend.component.ts b/webapp/src/app/shared/ui/topic-legend/topic-legend.component.ts
index ec776260..1d835d70 100644
--- a/webapp/src/app/shared/ui/topic-legend/topic-legend.component.ts
+++ b/webapp/src/app/shared/ui/topic-legend/topic-legend.component.ts
@@ -2,6 +2,8 @@ import { CommonModule } from '@angular/common';
import { Component, EventEmitter, Input, Output } from '@angular/core';
import { MatIconModule } from '@angular/material/icon';
import { MatTooltipModule } from '@angular/material/tooltip';
+import { ComponentTooltipDirective } from '../../../directives/component-tooltip.directive';
+import { LegendTooltipComponent } from '../legend-tooltip/legend-tooltip.component';
import {
TopicLegendGroup,
TopicLegendItem,
@@ -13,11 +15,17 @@ export type TopicLegendVariant = 'default' | 'compact';
@Component({
selector: 'app-topic-legend',
standalone: true,
- imports: [CommonModule, MatIconModule, MatTooltipModule],
+ imports: [
+ CommonModule,
+ MatIconModule,
+ MatTooltipModule,
+ ComponentTooltipDirective,
+ ],
templateUrl: './topic-legend.component.html',
styleUrl: './topic-legend.component.scss',
})
export class TopicLegendComponent {
+ readonly LegendTooltipComponent = LegendTooltipComponent;
@Input() groups: TopicLegendGroup[] = [];
@Input() title = 'Farben nach Fachgebiet';
@Input() infoTooltip =