Files
AFFiNE-Mirror/blocksuite/affine/components/src/slider/styles.ts
T
L-Sun 7aacfee789 feat(editor): bring back line width panel of brush in edgelss toolbar (#12514)
<!-- 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 -->
2025-05-26 05:49:31 +00:00

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);
}
`;