Skip to content

Commit b6839b7

Browse files
committed
refactor(design): Linear-aligned dual-theme tokens + inset-card shell
design tokens - color.ts rewritten via lch(): hue 282 (light) / 272 (dark), paired L sums ~100 (mirror constraint). Status colors split fg/bg per theme and opted out of the mirror (semantics > aesthetics). Brand lavender theme-invariant; only hover/focus pivots between themes. - sidebar chrome tokens introduced (bgSidebar / bgSidebarRow / bgSidebarChip / sidebarTreeLine). bgSidebar = canvas — sidebar and AppShell outer wrapper share the chrome plane so the focal main card is the only contrasting surface. - hairline ladder rebalanced (>=2.5 L away from surface1 in both themes); original Linear-measured L=6.77 collided with our surface1. - chrome tokens for sidebar geometry (width 244, row 28, header 52, section gap 24, inset 12, indent 16). - typography: navItem (13/500) + navGroup (12/500) presets. - inverse* tokens for forced-polarity surfaces. theme switching - theme.css.ts: two createGlobalTheme blocks. :root, :root.dark default + :root.light override via specificity (0,2,0 > 0,1,0). - stores/ui.ts: toggle BOTH .dark and .light document classes (was dark-only — light never actually applied). shell layout - AppShell mainStyle becomes an inset card: surface1 + radius.md + 8px margin (6px left for sidebar gap) + hairline border + overflow hidden. Visible 3-plane ladder: sidebar (chrome) ↔ canvas gap ↔ main card (focal). - Sidebar redesigned to Linear rhythm: workspace header 52 px, rows 28 px, group gap 24 px, hierarchy by (lightness × indent × static 500 weight), no right border, counter pill with active-row text highlight, nested L4 subtree with connector line. - FullLayout / TwoColLayout repainted to surface1 so all panes share the focal plane inside the inset card; pane divider lifted from hairlineTertiary to hairline (whisper hairline vanishes against surface1). - ColumnHeader rootRecipe bg: canvas → surface1 (used by ListSubHeader + PostHeader; keeps the focal plane unified). - RightPane paneStyle bg: canvas → surface1 (same intent). DESIGN.md - §0 dual-theme philosophy added. - §1 rewritten as dual-theme palette: mechanics, surface ladder, sidebar chrome, hairlines, ink, brand (theme-invariant), status fg/bg, inverse, status dots. - §1.9 notification & list color encoding (Linear inbox audit): status colour rides only on ≤14 px glyphs, read/unread by ink strength only, max two colour cues per row, embed cards keep surface1 body + 2-3 px coloured left-border. - §7.5 sidebar three-axis hierarchy doc. - §7.6 main-as-inset-card shell with ASCII diagram. - §10 anti-patterns extended. - §12 calibration history v3-v6.
1 parent 516c61c commit b6839b7

25 files changed

Lines changed: 1342 additions & 295 deletions

File tree

DESIGN.md

Lines changed: 311 additions & 56 deletions
Large diffs are not rendered by default.

src/components/post-detail/header/KebabMenu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const KebabMenu = ({
3131
onDelete,
3232
}: KebabMenuProps) => {
3333
const [open, setOpen] = useState(false)
34-
const triggerSize = variant === 'compact' ? 'sm' : 'md'
34+
const triggerSize = 'sm'
3535

3636
const close = (fn?: () => void) => () => {
3737
setOpen(false)

src/components/post-detail/header/PostHeader.css.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const externalLinkFullStyle = style({
77
display: 'inline-flex',
88
alignItems: 'center',
99
gap: 6,
10-
height: 32,
10+
height: 28,
1111
paddingInline: '10px',
1212
background: 'transparent',
1313
border: 'none',

src/components/post-detail/header/PostHeader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const PostHeader = ({
4141
onOpenDiff,
4242
externalUrl,
4343
}: PostHeaderProps) => {
44-
const iconSize = variant === 'compact' ? 'sm' : 'md'
44+
const iconSize = 'sm'
4545
const isFull = variant === 'full'
4646
const title = post?.title ?? ''
4747
const publishDisabled = dirtyFieldCount === 0

src/components/post-detail/header/PublishMenu.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export const PublishMenu = ({
3838
<div className={publishMenuRootStyle} data-testid="publish-menu">
3939
<Button
4040
intent="primary"
41-
size={variant === 'full' ? 'md' : 'sm'}
41+
size="sm"
4242
disabled={disabled}
4343
onClick={onPublish}
4444
className={
@@ -55,7 +55,7 @@ export const PublishMenu = ({
5555
render={
5656
<Button
5757
intent="primary"
58-
size={variant === 'full' ? 'md' : 'sm'}
58+
size="sm"
5959
aria-label="发布选项"
6060
className={
6161
variant === 'full'

src/components/ui/ColumnHeader/ColumnHeader.css.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const rootRecipe = recipe({
99
display: 'flex',
1010
alignItems: 'center',
1111
height: chrome.headerHeight,
12-
background: themeContract.color.canvas,
12+
background: themeContract.color.surface1,
1313
borderBottom: `1px solid ${themeContract.color.hairline}`,
1414
flexShrink: 0,
1515
},

src/layouts/AppShell/AppShell.css.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,14 @@ export const mainStyle = style({
2727
display: 'flex',
2828
flexDirection: 'column',
2929
minWidth: 0,
30-
height: '100%',
30+
// Linear-style inset card: 主面浮于 chrome canvas 之上
31+
// canvas (gap) ←→ sidebar (deepest chrome) ←→ main card (brightest focal)
32+
background: themeContract.color.surface1,
33+
borderRadius: themeContract.radius.md,
34+
marginBlock: '8px',
35+
marginInlineEnd: '8px',
36+
marginInlineStart: '6px',
37+
border: `1px solid ${themeContract.color.hairline}`,
3138
overflow: 'hidden',
3239
})
3340

0 commit comments

Comments
 (0)