Skip to content

Commit

Permalink
enhance: improve some error messages about measuring css length
Browse files Browse the repository at this point in the history
  • Loading branch information
awmleer committed May 30, 2022
1 parent 062ae05 commit b0bd5ee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/measure-css-length.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { isDev } from './is-dev'
import { devError } from './dev-log'

export function measureCSSLength(raw: string | undefined | null): number {
if (raw === null || raw === undefined) {
if (raw === null || raw === undefined || raw === '') {
if (isDev) {
devError(
'Global',
Expand All @@ -25,7 +25,7 @@ export function measureCSSLength(raw: string | undefined | null): number {
if (isDev) {
devError(
'Global',
'You are using a not supported CSS unit. Only `px` `rem` and `vw` are supported.'
`You are using a not supported CSS unit in \`${raw}\`. Only \`px\` \`rem\` and \`vw\` are supported.`
)
}
return 0
Expand Down

0 comments on commit b0bd5ee

Please sign in to comment.