carbon-design-system/carbon-preprocess-svelte

rgba hex value warning

pheuter opened this issue · 3 comments

I keep getting the following logged during npm run check and npm run build and it's unclear what's causing it, curious if anyone else ran into similar messages:

====================================
Loading svelte-check in workspace: /Users/mark/src/svelte-app
Getting Svelte diagnostics...

[carbon:elements] rgba hex value must be six characters. Received "#0"
[carbon:elements] rgba hex value must be six characters. Received "#0"
====================================
svelte-check found 0 errors, 0 warnings, and 0 hints

Currently, it's hardcoded to expect a value length of 6 characters. Could you try "#000000"?

Ah, I was struggling to even find the source of that message, looks like it has to do with anywhere we call rgba(), and I had it in one place:

box-shadow: 0px -4px 6px -1px rgba(0, 0, 0, 0.1), 0px -2px 4px -1px rgba(0, 0, 0, 0.06);

I'm not sure what values to change it to, "#0" doesn't work:

[carbon:elements] rgba hex value must be six characters. Received "#'#0'"

This change appears to placate the preprocessor:

box-shadow: 0px -4px 6px -1px #00000019, 0px -2px 4px -1px #0000000f;