svelte-reactive-css-preprocess icon indicating copy to clipboard operation
svelte-reactive-css-preprocess copied to clipboard

Error in Readme.md

Open GuidoJansenPI opened this issue 2 years ago • 1 comments

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

GuidoJansenPI avatar Sep 13 '23 14:09 GuidoJansenPI

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>

Not-Jayden avatar Oct 01 '23 18:10 Not-Jayden