Skip to content

Commit

Permalink
Support passing down of class prop
Browse files Browse the repository at this point in the history
Support passing down off class prop for usage with libraries like [TailwindCSS](https://tailwindcss.com/)

[Example in REPL](https://svelte.dev/repl/1d0b80898137445da24cf565830ce3f7?version=3.4.2)
  • Loading branch information
domtronn authored Aug 6, 2022
1 parent 2411b0b commit f71a54c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/component-template.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
export let size = 24;
export let color = "currentColor";
export let strokeWidth = 2;
let clazz = '';
export { clazz as class }
</script>

<svg
xmlns='http://www.w3.org/2000/svg'
class='icon icon-tabler icon-tabler-%%ORIGINAL_NAME%%'
class='icon icon-tabler icon-tabler-%%ORIGINAL_NAME%% {clazz}'
width={size}
height={size}
viewBox='0 0 24 24'
Expand All @@ -17,4 +20,4 @@
stroke-linejoin='round'
>
%%SVG_CONTENT%%
</svg>
</svg>

0 comments on commit f71a54c

Please sign in to comment.