• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

CSS Not loading

Scheduled Pinned Locked Moved Solved Troubleshooting
7 Posts 2 Posters 708 Views 2 Watching
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.
  • M Offline
    mumblebaj Module Developer
    last edited by mumblebaj Aug 5, 2021, 4:14 PM Aug 5, 2021, 4:13 PM

    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?

    Check out my modules at: https://github.com/mumblebaj?tab=repositories

    S 1 Reply Last reply Aug 5, 2021, 4:20 PM Reply Quote 0
    • M Offline
      mumblebaj Module Developer @sdetweil
      last edited by Aug 5, 2021, 4:30 PM

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

      Check out my modules at: https://github.com/mumblebaj?tab=repositories

      S 1 Reply Last reply Aug 5, 2021, 4:31 PM Reply Quote 0
      • S Away
        sdetweil @mumblebaj
        last edited by Aug 5, 2021, 4:20 PM

        @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

        How to add modules

        learning how to use browser developers window for css changes

        M 1 Reply Last reply Aug 5, 2021, 4:24 PM Reply Quote 0
        • M Offline
          mumblebaj Module Developer @sdetweil
          last edited by Aug 5, 2021, 4:24 PM

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

          Check out my modules at: https://github.com/mumblebaj?tab=repositories

          S 1 Reply Last reply Aug 5, 2021, 4:26 PM Reply Quote 0
          • S Away
            sdetweil @mumblebaj
            last edited by Aug 5, 2021, 4:26 PM

            @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

            How to add modules

            learning how to use browser developers window for css changes

            M 1 Reply Last reply Aug 5, 2021, 4:30 PM Reply Quote 0
            • M Offline
              mumblebaj Module Developer @sdetweil
              last edited by Aug 5, 2021, 4:30 PM

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

              Check out my modules at: https://github.com/mumblebaj?tab=repositories

              S 1 Reply Last reply Aug 5, 2021, 4:31 PM Reply Quote 0
              • S Away
                sdetweil @mumblebaj
                last edited by Aug 5, 2021, 4:31 PM

                @mumblebaj lol, computers are fast and picky!!

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                M 1 Reply Last reply Aug 5, 2021, 4:33 PM Reply Quote 0
                • M Offline
                  mumblebaj Module Developer @sdetweil
                  last edited by Aug 5, 2021, 4:33 PM

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

                  Check out my modules at: https://github.com/mumblebaj?tab=repositories

                  1 Reply Last reply Reply Quote 0
                  • 1 / 1
                  1 / 1
                  • First post
                    5/7
                    Last post
                  Enjoying MagicMirror? Please consider a donation!
                  MagicMirror created by Michael Teeuw.
                  Forum managed by Sam, technical setup by Karsten.
                  This forum is using NodeBB as its core | Contributors
                  Contact | Privacy Policy