Files
AFFiNE-Mirror/blocksuite/affine/block-note/src/components/edgeless-note-background.css.ts
T
L-Sun 891d9df0b1 feat(editor): show doc title in page block (#9975)
Close [BS-2392](https://linear.app/affine-design/issue/BS-2392/page-block-需要显示文章title)

### What Changes
- Add `<doc-title>` to edgeless page block (a.k.a the first page visible note block)
- Refactors:
  - Move `<doc-title>` to `@blocksuite/affine-component`, but you can aslo import it from `@blocksuite/preset`
  - Extract `<edgeless-note-mask>` and `<edgeless-note-background>` from `<affine-edgeless-note>` to a seperate file
  - Rewrite styles of `<affine-edgeless-note>` with `@vanilla-extract/css`

https://github.com/user-attachments/assets/a0c03239-803e-4bfa-b30e-33b919213b12
2025-02-06 21:18:28 +00:00

28 lines
762 B
TypeScript

import { cssVar } from '@toeverything/theme';
import { style } from '@vanilla-extract/css';
import {
ACTIVE_NOTE_EXTRA_PADDING,
edgelessNoteContainer,
} from '../note-edgeless-block.css';
export const background = style({
position: 'absolute',
borderColor: cssVar('black10'),
left: 0,
top: 0,
width: '100%',
height: '100%',
selectors: {
[`${edgelessNoteContainer}[data-editing="true"] &`]: {
left: `${-ACTIVE_NOTE_EXTRA_PADDING}px`,
top: `${-ACTIVE_NOTE_EXTRA_PADDING}px`,
width: `calc(100% + ${ACTIVE_NOTE_EXTRA_PADDING * 2}px)`,
height: `calc(100% + ${ACTIVE_NOTE_EXTRA_PADDING * 2}px)`,
transition: 'left 0.3s, top 0.3s, width 0.3s, height 0.3s',
boxShadow: cssVar('activeShadow'),
},
},
});