style: button frame

This commit is contained in:
Steffen Becker committed 2026-06-25 16:24:30 +02:00
1 parent a5a38eb33a
commit 31d06809b7
7 files changed
+161 -68

No files matched your search

+59 -25
View File
@@ -440,21 +440,23 @@
</button>
<!-- Single Save / Export button → ODT, Raster PDF, or Vector PDF (beta). -->
<div class="save-split" use:exportMenuClickOutside>
<button class="file-action-btn save-main" onclick={handleSave} disabled={!editor || pdfBusy} title="Save .odt (Ctrl+S)">
{@render saveIcon()}
</button>
<button
class="save-chevron"
onclick={() => (exportMenuOpen = !exportMenuOpen)}
disabled={!editor || pdfBusy}
title="Save / Export"
aria-haspopup="menu"
aria-expanded={exportMenuOpen}
>
<svg width="8" height="8" viewBox="0 0 8 8" fill="none" aria-hidden="true">
<path d="M1 2.5l3 3 3-3" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</button>
<div class="save-control">
<button class="file-action-btn save-main" onclick={handleSave} disabled={!editor || pdfBusy} title="Save .odt (Ctrl+S)">
{@render saveIcon()}
</button>
<button
class="save-chevron"
onclick={() => (exportMenuOpen = !exportMenuOpen)}
disabled={!editor || pdfBusy}
title="Save / Export"
aria-haspopup="menu"
aria-expanded={exportMenuOpen}
>
<svg width="8" height="8" viewBox="0 0 8 8" fill="none" aria-hidden="true">
<path d="M1 2.5l3 3 3-3" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</button>
</div>
{#if exportMenuOpen}
<div class="theme-dropdown" role="menu">
<div class="theme-heading">Save / Export</div>
@@ -795,16 +797,48 @@
cursor: not-allowed;
}
/* Save split button: floppy + chevron that opens the Save As menu. */
/* Standalone file actions get a hover outline; save-main lives inside
.save-control, which carries its own shared border, so it's excluded. */
.file-actions > .file-action-btn {
border: 1px solid transparent;
transition: background 0.15s, border-color 0.15s;
}
.file-actions > .file-action-btn:hover:not(:disabled) {
border-color: var(--color-primary);
}
/* Save split button: floppy + chevron that opens the Save As menu, joined in
one bordered control whose shared border highlights on hover. */
.save-split {
position: relative;
display: inline-flex;
align-items: center;
}
.save-control {
display: inline-flex;
align-items: stretch;
height: 2rem;
border: 1px solid transparent;
border-radius: var(--radius);
overflow: hidden;
transition: border-color 0.15s;
}
.save-control:hover:not(:has(:disabled)) {
border-color: var(--color-primary);
}
.save-control:hover:not(:has(:disabled)) .save-chevron {
border-left-color: var(--color-border);
}
.save-main {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
width: auto;
height: 100%;
padding: 0 0.2rem 0 0.5rem;
border-radius: 0;
}
.save-chevron {
@@ -812,16 +846,15 @@
align-items: center;
justify-content: center;
width: 1rem;
height: 2rem;
height: 100%;
padding: 0;
border: none;
border-radius: var(--radius);
border-top-left-radius: 0;
border-bottom-left-radius: 0;
border-left: 1px solid transparent;
border-radius: 0;
background: transparent;
color: var(--color-text);
cursor: pointer;
transition: background 0.15s;
transition: background 0.15s, border-color 0.15s;
}
.save-chevron:hover:not(:disabled) {
@@ -923,16 +956,17 @@
justify-content: center;
width: 2rem;
height: 2rem;
border: none;
border: 1px solid transparent;
border-radius: var(--radius);
background: transparent;
color: var(--color-text);
cursor: pointer;
transition: background 0.15s;
transition: background 0.15s, border-color 0.15s;
}
.theme-btn:hover {
background: var(--color-btn-hover);
border-color: var(--color-primary);
}
.theme-dropdown {
+3 -2
View File
@@ -137,16 +137,17 @@
gap: 4px;
height: 2rem;
padding: 0 0.4rem;
border: none;
border: 1px solid transparent;
border-radius: var(--radius);
background: transparent;
color: var(--color-text);
cursor: pointer;
transition: background 0.15s;
transition: background 0.15s, border-color 0.15s;
}
.align-trigger:hover {
background: var(--color-btn-hover);
border-color: var(--color-primary);
}
.align-dropdown {
+45 -24
View File
@@ -67,26 +67,28 @@
</script>
<div class="history-split" use:popover>
<button
class="history-main"
onclick={runSingle}
disabled={!canRun}
title={direction === 'undo' ? 'Undo (Ctrl+Z)' : 'Redo (Ctrl+Shift+Z)'}
>
{direction === 'undo' ? '↩' : '↪'}
</button>
<button
class="history-caret"
onclick={toggle}
disabled={displayed.length === 0}
aria-haspopup="menu"
aria-expanded={open}
title={`${verb} history`}
>
<svg width="8" height="8" viewBox="0 0 8 8" fill="none" aria-hidden="true">
<path d="M1 2.5 L4 5.5 L7 2.5" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</button>
<div class="history-control">
<button
class="history-main"
onclick={runSingle}
disabled={!canRun}
title={direction === 'undo' ? 'Undo (Ctrl+Z)' : 'Redo (Ctrl+Shift+Z)'}
>
{direction === 'undo' ? '↩' : '↪'}
</button>
<button
class="history-caret"
onclick={toggle}
disabled={displayed.length === 0}
aria-haspopup="menu"
aria-expanded={open}
title={`${verb} history`}
>
<svg width="8" height="8" viewBox="0 0 8 8" fill="none" aria-hidden="true">
<path d="M1 2.5 L4 5.5 L7 2.5" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</button>
</div>
{#if open && displayed.length > 0}
<!-- svelte-ignore a11y_mouse_events_have_key_events -->
@@ -121,8 +123,26 @@
<style>
.history-split {
position: relative;
display: inline-flex;
align-items: center;
}
.history-control {
display: inline-flex;
align-items: stretch;
height: 2rem;
border: 1px solid transparent;
border-radius: var(--radius);
overflow: hidden;
transition: border-color 0.15s;
}
.history-control:hover:not(:has(:disabled)) {
border-color: var(--color-primary);
}
.history-control:hover:not(:has(:disabled)) .history-caret {
border-left-color: var(--color-border);
}
.history-main,
@@ -130,26 +150,27 @@
display: inline-flex;
align-items: center;
justify-content: center;
height: 2rem;
height: 100%;
border: none;
background: transparent;
color: var(--color-text);
font-size: 0.85rem;
font-family: var(--font-sans);
cursor: pointer;
transition: background 0.15s;
transition: background 0.15s, border-color 0.15s;
}
.history-main {
min-width: 2rem;
padding: 0 0.4rem;
border-radius: var(--radius) 0 0 var(--radius);
border-radius: 0;
}
.history-caret {
min-width: 1.1rem;
padding: 0 0.2rem;
border-radius: 0 var(--radius) var(--radius) 0;
border-left: 1px solid transparent;
border-radius: 0;
}
.history-main:hover:not(:disabled),
+3 -2
View File
@@ -187,16 +187,17 @@
min-width: 2rem;
height: 2rem;
padding: 0 0.5rem;
border: none;
border: 1px solid transparent;
border-radius: var(--radius);
background: transparent;
color: var(--color-text);
cursor: pointer;
transition: background 0.15s;
transition: background 0.15s, border-color 0.15s;
}
.char-trigger:hover {
background: var(--color-btn-hover);
border-color: var(--color-primary);
}
.char-trigger[aria-pressed='true'] {
+3 -2
View File
@@ -168,16 +168,17 @@
min-width: 2rem;
height: 2rem;
padding: 0 0.5rem;
border: none;
border: 1px solid transparent;
border-radius: var(--radius);
background: transparent;
color: var(--color-text);
cursor: pointer;
transition: background 0.15s;
transition: background 0.15s, border-color 0.15s;
}
.table-trigger:hover {
background: var(--color-btn-hover);
border-color: var(--color-primary);
}
.table-trigger[aria-pressed='true'] {
+33 -10
View File
@@ -202,11 +202,6 @@
<div class="toolbar-group">
<HistoryButton {editor} {tick} direction="undo" />
</div>
<div class="toolbar-separator"></div>
<div class="toolbar-group">
<HistoryButton {editor} {tick} direction="redo" />
</div>
{/if}
@@ -267,6 +262,17 @@
cursor: not-allowed;
}
/* Plain toolbar buttons gain a primary outline on hover (split buttons handle
their own; menu items keep border:none so border-color is a no-op). */
.toolbar-group > button {
border: 1px solid transparent;
transition: background 0.15s, border-color 0.15s;
}
.toolbar-group > button:hover:not(:disabled) {
border-color: var(--color-primary);
}
/* Ordered-list split button: main toggle + chevron that opens the numbering
style menu, rendered as one joined control. */
.ol-picker {
@@ -275,20 +281,37 @@
.ol-split {
display: inline-flex;
align-items: center;
align-items: stretch;
height: 2rem;
border: 1px solid transparent;
border-radius: var(--radius);
overflow: hidden;
transition: border-color 0.15s;
}
.ol-split:hover {
border-color: var(--color-primary);
}
.ol-split:hover .ol-chevron {
border-left-color: var(--color-border);
}
.ol-main {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
min-width: unset;
height: 100%;
padding: 0 0.2rem 0 0.5rem;
border-radius: 0;
}
.ol-chevron {
min-width: unset;
width: 1rem;
height: 100%;
padding: 0;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
border-left: 1px solid transparent;
border-radius: 0;
transition: background 0.15s, border-color 0.15s;
}
.ol-dropdown {
+15 -3
View File
@@ -1270,6 +1270,17 @@
cursor: not-allowed;
}
/* Plain toolbar buttons gain a primary outline on hover (combobox triggers and
split buttons handle their own; menu items keep border:none → no-op). */
.toolbar-group > button {
border: 1px solid transparent;
transition: background 0.15s, border-color 0.15s;
}
.toolbar-group > button:hover:not(:disabled) {
border-color: var(--color-primary);
}
.font-picker {
position: relative;
}
@@ -1494,16 +1505,17 @@
gap: 4px;
height: 2rem;
padding: 0 0.4rem;
border: 1px solid var(--color-border);
border: 1px solid transparent;
border-radius: var(--radius);
background: var(--color-surface);
background: transparent;
color: var(--color-text);
cursor: pointer;
min-width: unset;
transition: border-color 0.15s;
transition: background 0.15s, border-color 0.15s;
}
.lh-trigger:hover {
background: var(--color-btn-hover);
border-color: var(--color-primary);
}