Skip to content

Commit

Permalink
fix(useStyleTag): allow multiline CSS (#2476)
Browse files Browse the repository at this point in the history
  • Loading branch information
jameswragg committed Nov 25, 2022
1 parent 91ec774 commit cfcc295
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion packages/core/useStyleTag/demo.vue
@@ -1,7 +1,12 @@
<script setup lang="ts">
import { useStyleTag } from '@vueuse/core'
const { id, css, load, unload, isLoaded } = useStyleTag('.demo { background: #ad4c2e50 }')
const customCSS = `
.demo { background: #ad4c2e50; }
.demo textarea { background: lightyellow; }
`.trim()
const { id, css, load, unload, isLoaded } = useStyleTag(customCSS)
</script>

<template>
Expand Down
2 changes: 1 addition & 1 deletion packages/core/useStyleTag/index.ts
Expand Up @@ -87,7 +87,7 @@ export function useStyleTag(
stop = watch(
cssRef,
(value) => {
el.innerText = value
el.textContent = value
},
{ immediate: true },
)
Expand Down

0 comments on commit cfcc295

Please sign in to comment.