mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-12 23:56:36 +08:00
eac8f32f4c
* Updated `border-radius` of panel to `8px`. [BS-2901](https://linear.app/affine-design/issue/BS-2901/meta-info-ui-issue) [BS-2810](https://linear.app/affine-design/issue/BS-2810/toolbarpicker-圆角更新为-8px) * Refactored basic styles of font and panel. <img width="549" alt="Screenshot 2025-03-31 at 12 56 36" src="https://github.com/user-attachments/assets/4a827e1e-f802-4251-a563-4a34b891a5e3" />
53 lines
1.2 KiB
TypeScript
53 lines
1.2 KiB
TypeScript
import { panelBaseStyle } from '@blocksuite/affine-shared/styles';
|
|
import { stopPropagation } from '@blocksuite/affine-shared/utils';
|
|
import { WithDisposable } from '@blocksuite/global/lit';
|
|
import { css, html, LitElement } from 'lit';
|
|
|
|
export class EditorToolbar extends WithDisposable(LitElement) {
|
|
static override styles = css`
|
|
${panelBaseStyle(':host')}
|
|
:host {
|
|
height: 36px;
|
|
box-sizing: content-box;
|
|
}
|
|
|
|
:host([data-without-bg]) {
|
|
border-color: transparent;
|
|
background: transparent;
|
|
box-shadow: none;
|
|
}
|
|
|
|
::slotted(*) {
|
|
display: flex;
|
|
height: 100%;
|
|
justify-content: center;
|
|
align-items: center;
|
|
gap: 8px;
|
|
color: var(--affine-text-primary-color);
|
|
fill: currentColor;
|
|
}
|
|
`;
|
|
|
|
override connectedCallback() {
|
|
super.connectedCallback();
|
|
|
|
this._disposables.addFromEvent(this, 'pointerdown', (e: PointerEvent) => {
|
|
e.stopPropagation();
|
|
e.preventDefault();
|
|
});
|
|
this._disposables.addFromEvent(this, 'wheel', stopPropagation, {
|
|
passive: false,
|
|
});
|
|
}
|
|
|
|
override render() {
|
|
return html`<slot></slot>`;
|
|
}
|
|
}
|
|
|
|
declare global {
|
|
interface HTMLElementTagNameMap {
|
|
'editor-toolbar': EditorToolbar;
|
|
}
|
|
}
|