Read the statement by Michael Teeuw here.
CSS Not loading
-
Hi. I am busy writing my first module. Yesterday while testing everything worked perfect, css loaded fine etc. Today I removed the module from my modules folder and re-installed from git. When I start up the mirror, the CSS file does not load. It seems to load the default styles instead.
In my main module file I have the following:
getStyles: function() { return ["MMM-NewsAPI.css"] },
I have looked everywhere and tried everything but the my CSS is just ignored and the default is loaded.
Anybody have any idea what may be wrong?
-
@sdetweil Ag, you know what, if I could smack myself upside the head…I WOULD. I had a simple spelling error. I saw now that I named it getStles missing the Y. It is working again.
-
@mumblebaj said in CSS Not loading:
return [“MMM-NewsAPI.css”]
where do you think that file is? (module folder)
and where do you think MM is running at the time? (MagicMirror folder)you need to give the path to the css file
this.file(cssfile) will give u the full path
return [this.file(“MMM-NewsAPI.css”)]
-
@sdetweil Thanks for the reply Sam.
I have tried that and that didn’t work either. :crying_face: I have just updated now and it still doesn’t work. -
@mumblebaj where is the css file?
show me ,
ls whatever folder -laF
custom.css doesn’t exist by default, u have to create it to use it.
(my installer script creates it for you) -
@sdetweil Ag, you know what, if I could smack myself upside the head…I WOULD. I had a simple spelling error. I saw now that I named it getStles missing the Y. It is working again.
-
@mumblebaj lol, computers are fast and picky!!
-
@sdetweil I can’t believe I didn’t see it. I have 4 different screens open. Wrote another little program on the side to verify that the styles are working properly. Everything. Just to see now I left out the Y in Styles. Thanks again Sam. You made me look closer. Else I would still be sitting here searching.