Skip to content

Commit

Permalink
🐛 same size on the arrow #2375 (#2381)
Browse files Browse the repository at this point in the history
* 🐛 same size on the arrow

* 🎨 cleanup

* 🎨 adjust size
  • Loading branch information
BorghildSelle authored Jun 18, 2024
1 parent b075ada commit ae47005
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 8 deletions.
3 changes: 2 additions & 1 deletion web/core/Link/ReadMoreLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,14 @@ export const ReadMoreLink = forwardRef<HTMLAnchorElement, ReadMoreLinkProps>(fun
}
const iconClassNames = twMerge(
`
size-arrow-right
text-energy-red-100
dark:text-white-100
ml-2
${
type === 'downloadableFile' || type === 'downloadableImage'
? 'group-hover:translate-y-0.5'
: '-translate-y-1 group-hover:translate-x-2'
: '-translate-y-0.5 group-hover:translate-x-2'
}
transition-all
duration-300
Expand Down
2 changes: 1 addition & 1 deletion web/core/Link/ResourceLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ export const ResourceLink = forwardRef<HTMLAnchorElement, ResourceLinkProps>(fun

const iconClassNames = twMerge(
`
size-arrow-right
text-energy-red-100
dark:text-white-100
justify-self-end
max-h-[25px]
${iconRotation[type]}
${
type === 'downloadableFile' || type === 'downloadableImage'
Expand Down
3 changes: 1 addition & 2 deletions web/icons/ArrowRight.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { forwardRef, Ref, SVGProps } from 'react'
import { arrow_forward } from '@equinor/eds-icons'
import { twMerge } from 'tailwind-merge'

export type ArrowRightProps = {
/** Size, use if you need large icon resolutions
Expand Down Expand Up @@ -29,7 +28,7 @@ export const ArrowRight = forwardRef<SVGSVGElement, ArrowRightProps>(function Ar
viewBox={`0 0 ${size} ${size}`}
fill="currentColor"
aria-hidden
className={twMerge(`h-full w-auto`, className)}
className={className}
{...rest}
>
{Array.isArray(icon.svgPathData) ? (
Expand Down
2 changes: 1 addition & 1 deletion web/sections/Grid/GridLinkArrow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const GridLinkArrow = ({ theme, action, className }: GridLinkArrowProps) => {
<span className="sr-only">{`${action.label} ${
action.extension ? `(${action.extension.toUpperCase()})` : ''
}`}</span>
<ArrowRight className={`w-10 h-10`} />
<ArrowRight className={`size-10`} />
</BaseLink>
</div>
)}
Expand Down
4 changes: 3 additions & 1 deletion web/sections/PromoTiles/PromoTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ export const FakeReadMoreLink = ({ type = 'internalUrl', children }: FakeReadMor
after:duration-300
group-hover/card:after:w-full
`
const iconClassNames = `text-energy-red-100
const iconClassNames = `
size-arrow-right
text-energy-red-100
${type === 'externalUrl' ? '-rotate-45' : ''}
dark:text-white-100
ml-2
Expand Down
2 changes: 1 addition & 1 deletion web/sections/cards/Card/CardContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const CardContent = forwardRef<HTMLDivElement, CardContentProps>(function
}
const iconClassNames = twMerge(
`
max-h-8
size-arrow-right
text-energy-red-100
dark:text-white-100
mr-2
Expand Down
3 changes: 3 additions & 0 deletions web/tailwind.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@ module.exports = {
'5xl': ['clamp(calc(51.97 / 16 * 1rem), 2.55vw + 2.64rem, calc(91.31 / 16 * 1rem))'],
'6xl': ['clamp(calc(58.05 / 16 * 1rem), 2.94vw + 2.925rem, calc(103.39 / 16 * 1rem))'],
},
size: {
'arrow-right': '1.58rem',
},
fontWeight: {
semibolder: 650,
//--fontWeight-bold: tw -> semibold
Expand Down
3 changes: 2 additions & 1 deletion web/twMerge/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ const envisTwMerge = extendTailwindMerge({
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
maxWidth: ['viewport'],
minWidthh: ['viewport'],
minWidth: ['viewport'],
size: ['arrow-right'],
},
},
})
Expand Down

0 comments on commit ae47005

Please sign in to comment.