fix: align the primary sidebar divider
The primary sidebar resize hit target still reserved four pixels in the flex row, leaving a visible gap between the divider and the content frame. Its opposing negative margins now keep the nine-pixel pointer target layout-neutral while preserving the aligned one-pixel divider. Release note: 修复主侧栏拖拽分隔线与内容边缘未对齐的问题。
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { readFileSync } from 'node:fs'
|
||||
import { join } from 'node:path'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
|
||||
const stylesheet = readFileSync(
|
||||
join(process.cwd(), 'src', 'renderer', 'src', 'styles.css'),
|
||||
'utf8'
|
||||
).replaceAll('\r\n', '\n')
|
||||
|
||||
describe('primary sidebar layout', () => {
|
||||
it('keeps the resize hit target from adding space beside the divider', () => {
|
||||
const rule = stylesheet.match(
|
||||
/\.primary-sidebar-resize-handle\s*\{([^}]*)\}/u
|
||||
)?.[1]
|
||||
|
||||
expect(rule).toContain('width: 9px;')
|
||||
expect(rule).toContain('margin-left: -5px;')
|
||||
expect(rule).toContain('margin-right: -4px;')
|
||||
})
|
||||
})
|
||||
@@ -2404,6 +2404,7 @@ textarea:focus-visible {
|
||||
min-width: 9px;
|
||||
padding: 0;
|
||||
margin-left: -5px;
|
||||
margin-right: -4px;
|
||||
background: transparent;
|
||||
cursor: col-resize;
|
||||
touch-action: none;
|
||||
|
||||
Reference in New Issue
Block a user