Skip to content

Commit

Permalink
💄 style: Fix BarList Hover style
Browse files Browse the repository at this point in the history
  • Loading branch information
canisminor1990 committed Jan 3, 2025
1 parent 72c61f2 commit 344a85a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/BarList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export interface BarListProps extends HTMLAttributes<HTMLDivElement> {
}

const BarList = forwardRef<HTMLDivElement, BarListProps>((props, ref) => {
const { cx, styles } = useStyles();
const { cx, styles, prefixCls } = useStyles();
const themeColorRange = useThemeColorRange();
const {
data = [],
Expand Down Expand Up @@ -102,7 +102,7 @@ const BarList = forwardRef<HTMLDivElement, BarListProps>((props, ref) => {
return (
<Flexbox
align={'center'}
className={styles.barContainer}
className={cx(styles.barContainer, onValueChange && styles.barHover)}
height={rowHeight}
horizontal
key={item.key ?? index}
Expand All @@ -115,7 +115,7 @@ const BarList = forwardRef<HTMLDivElement, BarListProps>((props, ref) => {
width={'100%'}
>
<div
className={cx(styles.bar, onValueChange && styles.barHover)}
className={cx(`${prefixCls}-chart-bar-item`, styles.bar)}
style={{
background: item.color ?? color,
transition: showAnimation ? undefined : 'none',
Expand Down
6 changes: 4 additions & 2 deletions src/BarList/styles.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createStyles } from 'antd-style';

export const useStyles = createStyles(({ css, token }) => ({
export const useStyles = createStyles(({ prefixCls, css, token }) => ({
bar: css`
position: absolute;
top: 0;
Expand All @@ -20,7 +20,9 @@ export const useStyles = createStyles(({ css, token }) => ({
`,
barHover: css`
&:hover {
opacity: 0.4;
.${prefixCls}-chart-bar-item {
opacity: 0.4;
}
}
`,
emphasis: css`
Expand Down

0 comments on commit 344a85a

Please sign in to comment.