Skip to content

mouse484/svelte-inline-css

Repository files navigation

svelte-inline-css

Easy to use inline style system like Vue.js inline style in Svelte(Use use:action)

Try it -> REPL

Installation

yarn add svelte-inline-css

Usage

<script lang="ts">
  import style from 'svelte-inline-css';
  export let height: `${number}px` = '0px';
</script>

<div use:style={{ height }} />
<div use:style={{ color: 'red' }}>red</div>