1

I imported the semantic-ui css to the top Vue component in my app(App.vue) as the following

<style>
    @import '/assets/css/semantic.rtl.min.css';
</style>

but the Css is not available and not applied I am well aware that I could import CSS files in index.html but I wanted to load it in the app so it got compile in to one file along other files. in general what is the best way for importing global static CSS files to VueJs? should I do some more configuration for properly loading the CSS files?

1 Answer 1

4

You can import the CSS file in main.js. See the example below:

import Vue from 'vue';
import './assets/css/semantic.rtl.min.css';

Vue.config.productionTip = false;

new Vue({
  render: h => h(App)
}).$mount('#app')

In build time your CSS file will be processed.

Sign up to request clarification or add additional context in comments.

1 Comment

thanks,your solution definitely is the correct answer to the question in title, but for me beside the import problem there was a problem with semantic-ui build also, so I rebuild it based on solution on this link and now importing it the way you described above works fine

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.