Skip to content

Commit 6c26270

Browse files
committed
Refactor CSS extraction fn
1 parent fc83a38 commit 6c26270

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/SvelteToast.svelte

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,9 @@ const defaults = {
1515
theme: {}
1616
}
1717
toast._opts(defaults)
18-
1918
$: toast._opts(options)
2019
21-
const getCss = theme => {
22-
let css = ''
23-
for (const [key, val] of Object.entries(theme)) {
24-
css += `${key}:${val};`
25-
}
26-
return css || undefined
27-
}
20+
const getCss = theme => Object.keys(theme).reduce((a, c) => `${a}${c}:${theme[c]};`, '')
2821
</script>
2922

3023
<style>

0 commit comments

Comments
 (0)