sveltejs / svelte-preprocess

A ✨ magical ✨ Svelte preprocessor with sensible defaults and support for: PostCSS, SCSS, Less, Stylus, Coffeescript, TypeScript, Pug and much more.
MIT License
1.73k stars 147 forks source link

feat(processors): civet #627

Closed Shyam-Chen closed 2 months ago

Shyam-Chen commented 3 months ago

Add @danielx/civet.

Before submitting the PR, please make sure you do the following

Tests

image

image

<script lang="civet">
  count .= $state 0

  function increment: void
    count += 1
</script>

<template lang="pug">
  button.XButton(onclick!="{() => increment()}").
    clicks: {count}
</template>

<style lang="styl">
  .XButton
    color #f96743
</style>
<script>
  let count = $state(0);

  function increment() {
    count += 1;
  }
</script>

<button class="XButton" onclick="{() => increment()}">
  clicks: {count}
</button>

<style>
  .XButton {
    color: #f96743;
  }
</style>
Shyam-Chen commented 2 months ago

duplicate of #600