mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-22 12:36:24 +08:00
7aacfee789
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added the ability to select line width for pen tools, allowing users to customize brush and highlighter thickness in the toolbar menu. - **Bug Fixes** - Restored and verified the functionality for adding brush elements with different sizes, ensuring accurate rendering of brush strokes based on selected size. - **Improvements** - Enhanced slider component interaction by refining pointer event handling and updated slider styles for better touch interaction support. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
80 lines
1.8 KiB
TypeScript
80 lines
1.8 KiB
TypeScript
import { unsafeCSSVarV2 } from '@blocksuite/affine-shared/theme';
|
|
import { css } from 'lit';
|
|
|
|
export const styles = css`
|
|
:host {
|
|
display: block;
|
|
touch-action: none;
|
|
}
|
|
|
|
:host([disabled]) {
|
|
opacity: 0.5;
|
|
pointer-events: none;
|
|
}
|
|
|
|
.slider-container {
|
|
--drag-handle-center-x: calc(
|
|
(var(--item-size) - var(--drag-handle-size)) / 2 +
|
|
(var(--cursor) / (var(--count) - 1)) *
|
|
calc(var(--width) - var(--item-size))
|
|
);
|
|
|
|
width: var(--width);
|
|
height: 24px;
|
|
display: flex;
|
|
flex-direction: row;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
position: relative;
|
|
cursor: default;
|
|
}
|
|
|
|
.point-button {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: var(--item-size);
|
|
height: var(--item-size);
|
|
z-index: 2;
|
|
}
|
|
|
|
.point-circle {
|
|
width: var(--item-icon-size);
|
|
height: var(--item-icon-size);
|
|
background-color: ${unsafeCSSVarV2('layer/insideBorder/border')};
|
|
border-radius: 50%;
|
|
}
|
|
|
|
.point-button[data-selected] .point-circle {
|
|
background-color: ${unsafeCSSVarV2('icon/primary')};
|
|
}
|
|
|
|
.drag-handle {
|
|
position: absolute;
|
|
width: var(--drag-handle-size);
|
|
height: var(--drag-handle-size);
|
|
border-radius: 50%;
|
|
background-color: ${unsafeCSSVarV2('icon/primary')};
|
|
z-index: 3;
|
|
left: var(--drag-handle-center-x);
|
|
}
|
|
|
|
.bottom-line,
|
|
.slider-selected-overlay {
|
|
position: absolute;
|
|
height: 1px;
|
|
left: calc(var(--item-size) / 2);
|
|
}
|
|
|
|
.bottom-line {
|
|
width: calc(100% - var(--item-size));
|
|
background-color: ${unsafeCSSVarV2('layer/insideBorder/border')};
|
|
}
|
|
|
|
.slider-selected-overlay {
|
|
background-color: ${unsafeCSSVarV2('icon/primary')};
|
|
z-index: 1;
|
|
width: var(--drag-handle-center-x);
|
|
}
|
|
`;
|