Home

tailwind-ctp-intellisense @85f4995e71e87e474ea3918f48c647bf26f0709d - refs - log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
Tailwind intellisense + Catppuccin
tailwind-ctp-intellisense / packages / tailwindcss-language-service / src / util / remToPx.ts
- raw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
export function remToPx(
  value: string,
  rootSize: number = 16
): string | undefined {
  if (/^-?[0-9.]+rem$/.test(value)) {
    let number = parseFloat(value.substr(0, value.length - 3))
    if (!isNaN(number)) {
      return `${number * rootSize}px`
    }
  }
  return undefined
}