svelte-reactive-css-preprocess
svelte-reactive-css-preprocess copied to clipboard
Error in Readme.md
In the readme.md you have this line export let size = 200
You probably meant export let sizepx = 200, otherwise the var(--sizepx) make no sense
There's no error, sizepx is defined as a reactive variable 3 lines below
<script> // Create some variables that hold information about the component's style. export let size = 200; export let color = '#f00'; $: sizepx = `${size}px`; </script> <div class="square"></div> <style> .square { /* Reference the Svelte variables using the var(--varname) syntax */ width: var(--sizepx); height: var(--sizepx); background-color: var(--color); } </style>