Files
cinny/src/app/components/title-bar/TitleBar.css.ts
Max Litruv Boonzaayer 9c7f71896c fix: rework compact nav and centralized back routing
Use master-detail layout on skinny windows so server and channel lists share one screen, with back returning to the space list instead of redirect loops. Add useBackRoute for title-bar and page-header back buttons with view transitions.
2026-07-09 04:22:07 +10:00

113 lines
2.5 KiB
TypeScript

import { style, keyframes } from '@vanilla-extract/css';
import { color, config } from 'folds';
const wipeIn = keyframes({
'0%': {
clipPath: 'inset(0 100% 0 0)',
opacity: 0,
},
'100%': {
clipPath: 'inset(0 0 0 0)',
opacity: 1,
},
});
const wipeOut = keyframes({
'0%': {
clipPath: 'inset(0 0 0 0)',
opacity: 1,
},
'100%': {
clipPath: 'inset(0 100% 0 0)',
opacity: 0,
},
});
export const NewMessagePill = style({
display: 'flex',
alignItems: 'center',
gap: config.space.S100,
backgroundColor: '#2E7D32',
color: '#ffffff',
padding: `${config.space.S100} ${config.space.S200}`,
borderRadius: '999px',
cursor: 'pointer',
fontSize: '12px',
fontWeight: 500,
whiteSpace: 'nowrap',
overflow: 'hidden',
maxWidth: '200px',
animation: `${wipeIn} 0.3s ease-out forwards`,
transition: 'background-color 0.15s ease',
WebkitAppRegion: 'no-drag',
selectors: {
'&:hover': {
backgroundColor: '#388E3C',
},
},
});
export const NewMessagePillExiting = style({
animation: `${wipeOut} 0.2s ease-in forwards`,
});
export const TitleBar = style({
display: 'flex',
alignItems: 'center',
justifyContent: 'space-between',
height: '32px',
minHeight: '32px',
backgroundColor: color.Surface.Container,
borderBottom: `1px solid ${color.Surface.ContainerLine}`,
position: 'relative',
zIndex: 1000,
userSelect: 'none',
WebkitUserSelect: 'none',
});
export const TitleBarDragRegion = style({
display: 'flex',
alignItems: 'center',
height: '100%',
flexGrow: 1,
paddingLeft: config.space.S200,
cursor: 'default',
WebkitAppRegion: 'drag',
color: color.Surface.OnContainer,
});
export const TitleBarBackButton = style({
WebkitAppRegion: 'no-drag',
flexShrink: 0,
});
export const SyncStatusBadge = style({
position: 'absolute',
left: '50%',
top: '50%',
transform: 'translate(-50%, -50%)',
padding: `${config.space.S100} ${config.space.S300}`,
borderRadius: config.radii.R300,
fontSize: '11px',
fontWeight: 500,
whiteSpace: 'nowrap',
zIndex: 1001,
pointerEvents: 'none',
WebkitAppRegion: 'no-drag',
});
export const SyncStatusSuccess = style({
backgroundColor: color.Success.Container,
color: color.Success.OnContainer,
});
export const SyncStatusWarning = style({
backgroundColor: color.Warning.Container,
color: color.Warning.OnContainer,
});
export const SyncStatusCritical = style({
backgroundColor: color.Critical.Container,
color: color.Critical.OnContainer,
});