SYNC: new object button refactor + diagram accesibility

This commit is contained in:
SPRINX0\prochazka
2025-07-16 10:48:58 +02:00
committed by Diflow
parent 982098672e
commit 2cd56d5041
6 changed files with 165 additions and 80 deletions

View File

@@ -4,11 +4,15 @@
export let icon;
export let title;
export let description;
export let enabled;
export let colorClass;
$: disabled = !enabled;
</script>
<div class="new-object-button" on:click>
<div class="new-object-button" on:click class:enabled class:disabled>
<div class="icon">
<FontIcon {icon} />
<FontIcon {icon} colorClass={enabled ? colorClass : null} />
</div>
<span class="title">{title}</span>
{#if description}
@@ -23,13 +27,16 @@
background-color: var(--theme-bg-1);
border-radius: 4px;
border: 1px solid var(--theme-border);
cursor: pointer;
display: flex;
flex-direction: column;
align-items: center;
}
.new-object-button:hover {
.new-object-button.enabled {
cursor: pointer;
}
.new-object-button.enabled:hover {
background-color: var(--theme-bg-2);
}
.icon {
@@ -48,4 +55,18 @@
font-size: 0.9em;
color: var(--theme-font-2);
}
.new-object-button.disabled .title {
color: var(--theme-font-2);
}
.new-object-button.disabled .description {
color: var(--theme-font-2);
}
.new-object-button.disabled .icon {
color: var(--theme-font-2);
}
.new-object-button.disabled {
cursor: not-allowed;
opacity: 0.5;
}
</style>