Skip to content

Commit

Permalink
fix: fix styling of ColorPicker
Browse files Browse the repository at this point in the history
  • Loading branch information
jikkai committed Nov 14, 2023
1 parent fa82ad0 commit d3b98eb
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 19 deletions.
1 change: 0 additions & 1 deletion packages/base-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
"build:doc": "storybook build"
},
"dependencies": {
"@rc-component/trigger": "^1.18.1",
"@univerjs/base-render": "workspace:*",
"@univerjs/core": "workspace:*",
"@univerjs/design": "workspace:*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
}

&-handler {
transform: translateY(-1px);

box-sizing: border-box;
width: @default-handler-size;
height: @default-handler-size;
Expand Down Expand Up @@ -110,7 +112,7 @@
&-slider-container {
display: flex;
flex-direction: row-reverse;
gap: var(--margin-xs);
gap: var(--margin-sm);

.color-picker-slider-group {
flex: 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ export function BorderPanel(props: IBorderPanelProps) {
return Icon && <Icon extend={{ colorChannel1: 'rgb(var(--primary-color))' }} />;
}

function stopPropagation(e: React.MouseEvent) {
e.stopPropagation();
}

return (
<section className={styles.uiPluginSheetsBorderPanel}>
<div className={styles.uiPluginSheetsBorderPanelPosition}>
Expand All @@ -150,12 +154,12 @@ export function BorderPanel(props: IBorderPanelProps) {
offset: [0, 18],
}}
overlay={
<section className={styles.uiPluginSheetsBorderPanelBoard}>
<section className={styles.uiPluginSheetsBorderPanelBoard} onClick={stopPropagation}>
<ColorPicker onChange={(value) => handleClick({ value }, BorderPanelType.COLOR)} />
</section>
}
>
<a className={styles.uiPluginSheetsBorderPanelButton} onClick={(e) => e.stopPropagation()}>
<a className={styles.uiPluginSheetsBorderPanelButton} onClick={stopPropagation}>
<PaintBucket extend={{ colorChannel1: 'rgb(var(--primary-color))' }} />
<span className={styles.uiPluginSheetsBorderPanelMoreIcon}>
<MoreDownSingle />
Expand All @@ -170,20 +174,22 @@ export function BorderPanel(props: IBorderPanelProps) {
offset: [0, 18],
}}
overlay={
<Menu>
{BORDER_SIZE_CHILDREN.map((item) => (
<MenuItem
key={item.value}
eventKey={item.value.toString()}
onClick={() => handleClick({ value: item.value }, BorderPanelType.STYLE)}
>
<BorderLine type={item.value} />
</MenuItem>
))}
</Menu>
<section onClick={stopPropagation}>
<Menu>
{BORDER_SIZE_CHILDREN.map((item) => (
<MenuItem
key={item.value}
eventKey={item.value.toString()}
onClick={() => handleClick({ value: item.value }, BorderPanelType.STYLE)}
>
<BorderLine type={item.value} />
</MenuItem>
))}
</Menu>
</section>
}
>
<a className={styles.uiPluginSheetsBorderPanelButton} onClick={(e) => e.stopPropagation()}>
<a className={styles.uiPluginSheetsBorderPanelButton} onClick={stopPropagation}>
<BorderLine type={BorderStyleTypes.THIN} />
<span className={styles.uiPluginSheetsBorderPanelMoreIcon}>
<MoreDownSingle />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

font-size: var(--font-size-lg);

border-radius: var(--border-radius-base);

&:hover {
background-color: rgb(var(--bg-color-hover));
}
Expand Down
3 changes: 0 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d3b98eb

Please sign in to comment.