/** * Desktop shell behaviour * ======================= * Rules that make the Tauri desktop window behave like an application rather * than a page. Everything is scoped to html[data-fe-shell='desktop'], which * src/utils/native-feel.ts sets in the desktop app only. A browser tab and the * mobile apps never match these selectors. * * Nothing here changes layout, size or colour while the window is active. */ /* Controls are not text. Selection stays on for everything that is content: * the reader, message previews in dialogs, settings values, code blocks. The * list is by role so new controls are covered without touching this file. */ html[data-fe-shell='desktop'] :is( button, summary, label, nav, [role='button'], [role='tab'], [role='tablist'], [role='tree'], [role='listbox'], [role='menu'], [role='menubar'], [role='toolbar'], [role='switch'], [role='checkbox'], [role='radio'], [data-tooltip] ) { -webkit-user-select: none; user-select: none; } /* A field inside one of the containers above must still take a caret. WebKit * refuses typing in an input that inherits user-select: none. */ html[data-fe-shell='desktop'] :is(input, textarea, [contenteditable]:not([contenteditable='false'])), html[data-fe-shell='desktop'] [contenteditable]:not([contenteditable='false']) * { -webkit-user-select: text; user-select: text; } /* Addresses in the reader head are buttons (a click copies them) but they are * also the text someone wants part of, so they stay selectable. */ html[data-fe-shell='desktop'] .fe-reader-meta [role='button'] { -webkit-user-select: text; user-select: text; } /* Desktop applications keep the arrow over buttons, rows and menu items. The * hand is for links. Resize handles and text fields keep their own cursors * because they are not in this list. */ html[data-fe-shell='desktop'] :is( button, summary, label, select, [role='button'], [role='tab'], [role='option'], [role='treeitem'], [role='menuitem'], [role='menuitemcheckbox'], [role='menuitemradio'], [role='switch'], [role='checkbox'], [role='radio'], .cursor-pointer ) { cursor: default; } /* Icons and chrome links should not tear off as a ghost image when the * pointer moves during a click. Elements that opt into dragging (message * rows) set the draggable attribute and are left alone. */ html[data-fe-shell='desktop'] :is(img, svg, a):not([draggable='true']) { -webkit-user-drag: none; } /* Background window. The accent drains out of the sidebar so the frontmost * window is the only one with colour in its chrome. Reading panes are left * alone: content does not dim. Token overrides are used instead of filter or * opacity, which would give the sidebar a new containing block and move any * fixed-position menu opened from it. */ html[data-fe-shell='desktop'][data-window-inactive] .fe-folders { --primary: var(--fe-l-500); --fg-link: var(--fg-secondary); --state-unread: var(--fg-muted); } html[data-fe-shell='desktop'][data-window-inactive].dark .fe-folders { --primary: var(--fe-n-400); }