clay icon indicating copy to clipboard operation
clay copied to clipboard

@clayui/css: Function `clay-get-fallback($var)` errors on a custom property without fallback value

Open pat270 opened this issue 3 years ago • 0 comments

clay-get-fallback(var(--gray-600) should return var(--gray-600) instead of this:

Build error:
 Error: $start-at: 2 is not a number.
    ╷
307 │           $fallback-value: str-slice(
    │ ┌──────────────────────────^
308 │ │             $var,
309 │ │             str-index($var, ',') + 2,
310 │ │             str-length($var) - 1
311 │ │         );
    │ └─────────^
    ╵

https://github.com/liferay/clay/blob/e1e7ba120b16b5e71cf5a876c775de1e8f83ee9f/packages/clay-css/src/scss/functions/_global-functions.scss#L284-L318

pat270 avatar May 06 '22 22:05 pat270