primefaces / primeicons

Icon Library for Prime UI Libraries
MIT License
273 stars 140 forks source link

Vite/Nuxt3 css import : Failed to parse source for import analysis because the content contains invalid JS syntax. You may need to install appropriate plugins to handle the .css file format. #645

Open robthepaper opened 2 years ago

robthepaper commented 2 years ago

Hi, got this error Failed to parse source for import analysis because the content contains invalid JS syntax. You may need to install appropriate plugins to handle the .css file format.

and solved it by copying the primeicons module folder in my project folder and rewiting the @font-face part

replacing : @font-face { font-family: 'primeicons'; font-display: block; src: url('./fonts/primeicons.eot'); src: url('./fonts/primeicons.eot?#iefix') format('embedded-opentype'), url('./fonts/primeicons.ttf') format('truetype'), url('./fonts/primeicons.woff') format('woff'), url('./fonts/primeicons.svg?#primeicons') format('svg'); font-weight: normal; font-style: normal; }

by @font-face { font-family: 'primeicons'; font-display: block; src: url('./fonts/primeicons.eot'); src: url('./fonts/primeicons.eot?#iefix') format('embedded-opentype'), url('./fonts/primeicons.ttf') format('truetype'), url('./fonts/primeicons.woff') format('woff'), url('./fonts/primeicons.svg?#primeicons') format('svg'); font-weight: normal; font-style: normal; }

very weird, maybe I missed something ?

robthepaper commented 2 years ago

sorry I just change font-family: 'primeicons'; to font-family: "primeicons";

so there is no error anymore

robthepaper commented 2 years ago

and I had to add !important in .pi class declaration to not get the square because my main css theme overrides the font-family font-family: 'primeicons'!important;

smorcuend commented 2 years ago

Same issue here @robotpapier. Is there any other solution than copy entire css file to my local project?