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

modifying css to only one instance of a module

Scheduled Pinned Locked Moved Custom CSS
7 Posts 3 Posters 1.5k Views 3 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.
  • N Offline
    N3RD
    last edited by Sep 4, 2019, 3:13 AM

    So I have 2 instances of the darkskyForecast split on my mirror, one for current (top left)and one for hourly/daily (top right). I am attempting to modify the margins/border/padding for the first instance but any reference I make is modifying both. IS there a super simple way to target one versus the other that I’m too blind to find by searching? thanks in advance!

    S S 2 Replies Last reply Sep 4, 2019, 3:31 AM Reply Quote 0
    • S Away
      sdetweil @N3RD
      last edited by sdetweil Sep 4, 2019, 11:47 AM Sep 4, 2019, 3:31 AM

      @N3RD make a copy of the module folder under another name.
      Then the css can be against two names
      U have to rename the module.js to match the folder name, AND edit the module.js and change the registration line name to match as well

      see strawberry’s response below

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      1 Reply Last reply Reply Quote 0
      • S Offline
        strawberry 3.141 Project Sponsor Module Developer @N3RD
        last edited by Sep 4, 2019, 5:45 AM

        @N3RD every module has a wrapper with an id. This is is the module identifier e.g. module_1_clock. There is no need to modify files. You can then target specifically that instance in CSS.

        #module_1_clock {
            margin: 20px;
        }
        

        you can find out the identifier in the DOM.

        Please create a github issue if you need help, so I can keep track

        S 1 Reply Last reply Sep 4, 2019, 11:46 AM Reply Quote 1
        • S Away
          sdetweil @strawberry 3.141
          last edited by Sep 4, 2019, 11:46 AM

          @strawberry-3-141 thanks… didn’t know we could use the identifier…

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          1 Reply Last reply Reply Quote 0
          • N Offline
            N3RD
            last edited by Sep 5, 2019, 12:16 AM

            @strawberry-3-141 thanks for the tip! Now to sound even more newb, how do I read the DOM??

            S 1 Reply Last reply Sep 5, 2019, 12:40 AM Reply Quote 0
            • S Away
              sdetweil @N3RD
              last edited by sdetweil Sep 5, 2019, 12:41 AM Sep 5, 2019, 12:40 AM

              @N3RD modules are numbered from top to bottom in config.js
              Also see the elements tab in the developers window

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              N 1 Reply Last reply Sep 5, 2019, 2:22 AM Reply Quote 0
              • N Offline
                N3RD @sdetweil
                last edited by Sep 5, 2019, 2:22 AM

                @sdetweil got it! thanks guys, I’m slowly building confidence to poke around more and tweak. And annoy my wife by constantly tinkering ;)

                1 Reply Last reply Reply Quote 0
                • 1 / 1
                1 / 1
                • First post
                  1/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