I've been attempting to style an SVG icon component using styled-components, but I'm encountering some issues as the styles I apply to the close icon are not taking effect.
import styled from 'styled-components'
import Close from './close.svg'
const CloseIcon = ({ className , ...props }) => <Close {...props} className={className} />
const styledCloseIcon = styled(CloseIcon)`
&.ui.modal {
.modal-icon-close {
width: 14px;
height: 24px;
fill: black;
top: 12px;
right: 14px;
}
}
`
export default styledCloseIcon
close.svg
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path d="M13.627 12.213l9.9 9.9-1.414 1.414-9.9-9.9-9.9 9.9L.9 22.113l9.9-9.9-9.9-9.9L2.314.9l9.9 9.9 9.899-9.9 1.414 1.415-9.9 9.9z"/>
</svg>
This close icon is utilized in a Semantic UI React modal
<Modal
size='small'
open={true}
closeIcon={<Close className='modal-icon-close'/>}
closeOnDimmerClick={false}
className={classNames(className)}
>