Files
AFFiNE-Mirror/blocksuite/affine/blocks/table/src/table-block-css.ts
T
DarkSky 6a2b73e76f feat(editor): improve database & table behavior (#15100)
fix #14982
fix #15028
fix #15099

#### PR Dependency Tree


* **PR #15100** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Prevented Enter handling during IME composition to avoid unintended
input.
* Avoided overwriting external native selections when interacting with
tables.
* Improved validation of inline text selection ranges for more reliable
behavior.

* **Enhancements**
* Scoped and refined text-selection styling and editability within
tables and cells.
  * Added managed sorting for Kanban views to control card ordering.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-06-11 13:50:23 +08:00

63 lines
1.6 KiB
TypeScript

import { css } from '@emotion/css';
const externalRangeSelectionSelector =
'affine-table[data-external-range-selection]';
const hiddenSelectionBackground = '#fff';
export const tableContainer = css({
display: 'block',
padding: '10px 0 18px 10px',
overflowX: 'auto',
overflowY: 'visible',
userSelect: 'none',
WebkitUserSelect: 'none',
'& *': {
userSelect: 'none',
WebkitUserSelect: 'none',
},
[`${externalRangeSelectionSelector} &::selection`]: {
backgroundColor: hiddenSelectionBackground,
},
[`${externalRangeSelectionSelector} & *::selection`]: {
backgroundColor: hiddenSelectionBackground,
},
[`${externalRangeSelectionSelector} & rich-text::selection`]: {
backgroundColor: hiddenSelectionBackground,
},
[`${externalRangeSelectionSelector} & rich-text *::selection`]: {
backgroundColor: hiddenSelectionBackground,
},
'::-webkit-scrollbar': {
height: '8px',
},
'::-webkit-scrollbar-thumb:horizontal': {
borderRadius: '4px',
backgroundColor: 'transparent',
},
'::-webkit-scrollbar-track:horizontal': {
backgroundColor: 'transparent',
height: '8px',
},
'&:hover::-webkit-scrollbar-thumb:horizontal': {
borderRadius: '4px',
backgroundColor: 'var(--affine-black-30)',
},
'&:hover::-webkit-scrollbar-track:horizontal': {
backgroundColor: 'var(--affine-hover-color)',
height: '8px',
},
});
export const tableWrapper = css({
overflow: 'visible',
display: 'flex',
flexDirection: 'row',
gap: '8px',
position: 'relative',
width: 'max-content',
});
export const table = css({});
export const rowStyle = css({});