Skip to content

Commit

Permalink
Style drawn marks with CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
eatyourgreens committed Jul 17, 2024
1 parent 9faebd9 commit 2d08058
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ const STROKE_WIDTH = 3
const SELECTED_STROKE_WIDTH = 6

const StyledGroup = styled.g`
stroke-width: ${STROKE_WIDTH}px;
&.active {
stroke-width: ${SELECTED_STROKE_WIDTH}px;
}
&:focus {
outline: none;
}
Expand Down Expand Up @@ -156,7 +162,7 @@ const Mark = forwardRef(function Mark(
data-testid="mark-mark"
aria-disabled={disabled ? 'true' : 'false'}
aria-label={label}
className='drawingMark'
className={`drawingMark ${isActive ? 'active' : ''}`}
dragging={dragging}
focusable
focusColor={focusColor}
Expand All @@ -166,9 +172,6 @@ const Mark = forwardRef(function Mark(
pointerEvents={pointerEvents}
ref={markRoot}
role='button'
strokeWidth={
isActive ? SELECTED_STROKE_WIDTH : STROKE_WIDTH
}
tabIndex={disabled ? -1 : 0}
transform={transform}
>
Expand Down

0 comments on commit 2d08058

Please sign in to comment.