BarSelect: system-natives <select> + colorScheme:dark (Versuch Vectorworks-Style)
User-Wunsch: Dropdowns wie bei Vectorworks — also nativer OS-Look statt Custom-Caret + custom Popup. BarSelect umgebaut: - appearance:none entfernt → WebKit/macOS rendert seinen eigenen Down-Caret - custom <Icon arrow_drop_down> entfernt - pill-Container weg, das <select>-Element selbst traegt jetzt direkt das pill-Styling (Hintergrund, Border, Border-Radius) - colorScheme: 'dark' inline und auch global in index.css gesetzt damit macOS-Native-Controls die Dark-Mode-Variante rendern index.css: - :root color-scheme: light (default) - @prefers-color-scheme: dark → color-scheme: dark - Wirkt auf alle nativen Controls (selects, scrollbars, checkboxen) Resultat: Klick auf ein Dropdown oeffnet das echte macOS-Popup-Menue (wie in Vectorworks) statt das HTML-Browser-Dropdown. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
+25
-31
@@ -84,8 +84,12 @@ const pillSelect = {
|
|||||||
fontSize: 10,
|
fontSize: 10,
|
||||||
}
|
}
|
||||||
|
|
||||||
// BarSelect: Icon roh links (kein Container) + pill-shaped Native-Select.
|
// BarSelect: Icon roh links + System-natives <select>. Kein appearance:none,
|
||||||
// joinedRight: rechte Pill-Kante flach, fuer Verkettung mit BarButton.
|
// kein eigener Caret — WebKit/macOS rendert sein eigenes Drop-Caret und
|
||||||
|
// oeffnet das Popup-Menue im OS-Style (wie Vectorworks).
|
||||||
|
//
|
||||||
|
// `colorScheme: 'dark'` triggert die macOS-Dark-Mode-Variante des nativen
|
||||||
|
// Controls. joinedRight bleibt erhalten fuer Verkettung mit BarButton.
|
||||||
function BarSelect({ icon, value, onChange, title, disabled, width, children, joinedRight }) {
|
function BarSelect({ icon, value, onChange, title, disabled, width, children, joinedRight }) {
|
||||||
return (
|
return (
|
||||||
<div title={title} style={{
|
<div title={title} style={{
|
||||||
@@ -96,35 +100,25 @@ function BarSelect({ icon, value, onChange, title, disabled, width, children, jo
|
|||||||
<Icon name={icon} size={13}
|
<Icon name={icon} size={13}
|
||||||
style={{ color: 'var(--text-muted)', flexShrink: 0 }} />
|
style={{ color: 'var(--text-muted)', flexShrink: 0 }} />
|
||||||
)}
|
)}
|
||||||
<div style={{
|
<select
|
||||||
position: 'relative',
|
value={value || ''}
|
||||||
height: BAR_H, width,
|
disabled={disabled}
|
||||||
background: 'var(--bg-input)',
|
onChange={(e) => onChange(e.target.value)}
|
||||||
border: '1px solid var(--border-light)',
|
style={{
|
||||||
borderTopLeftRadius: 999, borderBottomLeftRadius: 999,
|
height: BAR_H, width,
|
||||||
borderTopRightRadius: joinedRight ? 0 : 999,
|
fontSize: 11, color: 'var(--text-primary)',
|
||||||
borderBottomRightRadius: joinedRight ? 0 : 999,
|
background: 'var(--bg-input)',
|
||||||
borderRight: joinedRight ? 'none' : '1px solid var(--border-light)',
|
border: '1px solid var(--border-light)',
|
||||||
overflow: 'hidden', flexShrink: 0,
|
borderTopLeftRadius: 999, borderBottomLeftRadius: 999,
|
||||||
}}>
|
borderTopRightRadius: joinedRight ? 0 : 999,
|
||||||
<select
|
borderBottomRightRadius: joinedRight ? 0 : 999,
|
||||||
value={value || ''}
|
borderRight: joinedRight ? 'none' : '1px solid var(--border-light)',
|
||||||
disabled={disabled}
|
padding: '0 8px 0 10px',
|
||||||
onChange={(e) => onChange(e.target.value)}
|
colorScheme: 'dark',
|
||||||
style={{
|
cursor: disabled ? 'not-allowed' : 'pointer',
|
||||||
width: '100%', height: '100%', minWidth: 0,
|
outline: 'none', flexShrink: 0,
|
||||||
background: 'transparent', border: 'none', outline: 'none',
|
}}
|
||||||
padding: '0 22px 0 12px',
|
>{children}</select>
|
||||||
fontSize: 11, color: 'var(--text-primary)',
|
|
||||||
appearance: 'none', WebkitAppearance: 'none', MozAppearance: 'none',
|
|
||||||
cursor: disabled ? 'not-allowed' : 'pointer',
|
|
||||||
}}
|
|
||||||
>{children}</select>
|
|
||||||
<Icon name="arrow_drop_down" size={14}
|
|
||||||
style={{ position: 'absolute', right: 6, top: '50%',
|
|
||||||
transform: 'translateY(-50%)',
|
|
||||||
color: 'var(--text-muted)', pointerEvents: 'none' }} />
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
|
/* Native OS-Controls (selects, scrollbars) sollen dem aktuellen Theme
|
||||||
|
folgen. Wert wird im prefers-color-scheme: dark Block ueberschrieben. */
|
||||||
|
color-scheme: light;
|
||||||
|
|
||||||
/* === LIGHT MODE (RAPPORT cream + olive + deep green) === */
|
/* === LIGHT MODE (RAPPORT cream + olive + deep green) === */
|
||||||
--bg-base: #e0dbd4;
|
--bg-base: #e0dbd4;
|
||||||
--bg-panel: #e0dbd4;
|
--bg-panel: #e0dbd4;
|
||||||
@@ -75,6 +79,7 @@
|
|||||||
/* === DARK MODE (Rhino-tonig) === */
|
/* === DARK MODE (Rhino-tonig) === */
|
||||||
@media (prefers-color-scheme: dark) {
|
@media (prefers-color-scheme: dark) {
|
||||||
:root {
|
:root {
|
||||||
|
color-scheme: dark;
|
||||||
--bg-base: #2a2a2a;
|
--bg-base: #2a2a2a;
|
||||||
--bg-panel: #2a2a2a;
|
--bg-panel: #2a2a2a;
|
||||||
--bg-section: #2a2a2a;
|
--bg-section: #2a2a2a;
|
||||||
|
|||||||
Reference in New Issue
Block a user