In my React project inside theme.ts
I created some aliases to define my FontSizes
. I have to use quotes ''
for the keys, otherwise Typescript is complaining:
fontSizes: {
'xs': '12px',
'sm': '14px',
'md': '16px',
'lg': '18px',
'xl': '20px',
'2xl': '24px',
'4xl': '32px',
'5xl': '48px',
'6xl': '64px',
},
This is working fine.
But when I want to use a value 2xl
or 3xl
like font-size: ${theme.fontSizes.2xl};
I get this message:
An identifier or keyword cannot immediately follow a numeric literal.