MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord

    SOLVED CSS Not loading

    Troubleshooting
    2
    7
    260
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • mumblebaj
      mumblebaj Project Sponsor last edited by mumblebaj

      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.

      4f870fbe-c762-4cad-9c54-1c55ab14aae1-image.png

      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?

      S 1 Reply Last reply Reply Quote 0
      • mumblebaj
        mumblebaj Project Sponsor @sdetweil last edited by

        @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.

        S 1 Reply Last reply Reply Quote 0
        • S
          sdetweil @mumblebaj last edited by

          @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”)]

          Sam

          Create a working config
          How to add modules

          mumblebaj 1 Reply Last reply Reply Quote 0
          • mumblebaj
            mumblebaj Project Sponsor @sdetweil last edited by

            @sdetweil Thanks for the reply Sam.
            I have tried that and that didn’t work either. 😢 I have just updated now and it still doesn’t work.

            S 1 Reply Last reply Reply Quote 0
            • S
              sdetweil @mumblebaj last edited by

              @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)

              Sam

              Create a working config
              How to add modules

              mumblebaj 1 Reply Last reply Reply Quote 0
              • mumblebaj
                mumblebaj Project Sponsor @sdetweil last edited by

                @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.

                S 1 Reply Last reply Reply Quote 0
                • S
                  sdetweil @mumblebaj last edited by

                  @mumblebaj lol, computers are fast and picky!!

                  Sam

                  Create a working config
                  How to add modules

                  mumblebaj 1 Reply Last reply Reply Quote 0
                  • mumblebaj
                    mumblebaj Project Sponsor @sdetweil last edited by

                    @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.

                    1 Reply Last reply Reply Quote 0
                    • 1 / 1
                    • First post
                      Last post
                    Enjoying MagicMirror? Please consider a donation!
                    MagicMirror created by Michael Teeuw.
                    Forum managed by Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
                    This forum is using NodeBB as its core | Contributors
                    Contact | Privacy Policy