MagicMirror Forum

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

    Generic Config.js & Module Question

    General Discussion
    3
    5
    255
    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.
    • ankonaskiff17
      ankonaskiff17 last edited by

      If you go with the default settings that are coded in to each module, you can delete that from the config.js module script associated with each module?

      For example, if color: true, is the default and you are going to stick with true then you can delete that line in config.js because it is coded true in the file you installed in MagicMirror/modules?

      S BKeyport 2 Replies Last reply Reply Quote 0
      • S
        sdetweil @ankonaskiff17 last edited by

        @ankonaskiff17 correct… the design is the config.js settings replace to defaults in the module code.

        if they are not specified in config.js then there is nothing to replace with, so the defaults are used

        this makes it so you only have to specify what you need

        Sam

        Create a working config
        How to add modules

        1 Reply Last reply Reply Quote 0
        • BKeyport
          BKeyport Module Developer @ankonaskiff17 last edited by BKeyport

          @ankonaskiff17 Yes. I think of it this way (Not quite correct, but it helps me wrap my head around it)

          Loading order:
          config in MM
          config in module
          config in config.js

          Same for CSS
          CSS in MM
          CSS in module’s CSS
          CSS in custom.css

          Each step inherits the previous by default, then overrides with new if specified.

          The "E" in "Javascript" stands for "Easy"

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

            @bkeyport its better to think of it as a stack

            custom
            
            module(s)
            
            main
            

            topmost wins

            same for config

            config.js
            
            module
            

            Sam

            Create a working config
            How to add modules

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

              @sdetweil @BKeyport just trigggered a question on inheritance. On several occasions when I have Developer Tool up to look at something , I’ll see message text that is roughly “X is inherited from body” or from main. Been a while since I was really poking around in developer tool mode. Think above was in context of CSS. So in event you want to change X, how do you tackle without it having global impact?

              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