Skip to content

Commit ced9dfe

Browse files
committed
refactor(shared): use pixelToRem
1 parent 2683f8d commit ced9dfe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

shared/components/Icon/Icon.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types'
33
import styled from 'styled-components'
44

55
import { colorIconPrimary, colorIconSecondary, colorCardinal, colorWhite } from '@tds/core-colours'
6-
import { safeRest } from '@tds/util-helpers'
6+
import { safeRest, pixelToRem } from '@tds/util-helpers'
77

88
import icons from './icons'
99

@@ -23,7 +23,7 @@ const getColour = variant => {
2323
}
2424
const iconSymbol = ({ symbol }) => ({ ...icons.default, ...icons[symbol] })
2525
const iconVariant = ({ variant }) => ({ color: getColour(variant) })
26-
const iconSize = ({ iSize }) => ({ fontSize: `${iSize / 16}rem` })
26+
const iconSize = ({ iSize }) => ({ fontSize: pixelToRem(iSize) })
2727

2828
export const StyledIcon = styled.i(iconSymbol, iconVariant, iconSize)
2929

0 commit comments

Comments
 (0)