Creating a component library and CSS is ignored #10957
-
I'm trying to create an small component library but for some reason when I import the component the css is completely ignored. I did export it with: "exports": {
...
"./style.css": "./dist/style.css"
}, I have not published on npm because of this issue. I'm importing it locally in another project for testing using Here is my repo https://github.com/LuzAramburo/vue-sparkly-text |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
// src/index.ts
import './style.css';
export { default as SparklyText } from './components/VueSparklyText.vue'; <script lang="ts" setup>
import SparklyText from 'vue-sparkly-text';
</script>
<template>
<p>Lorem ipsum dolor <SparklyText>sparkly text</SparklyText> sit amet.</p>
</template> or
<script lang="ts" setup>
import 'vue-sparkly-text/style.css';
import SparklyText from 'vue-sparkly-text';
</script>
<template>
<p>Lorem ipsum dolor <SparklyText>sparkly text</SparklyText> sit amet.</p>
</template> |
Beta Was this translation helpful? Give feedback.
-
I was missing the import for the css on the index file 🙏 thanks! |
Beta Was this translation helpful? Give feedback.
or