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

calendar

Scheduled Pinned Locked Moved Custom CSS
10 Posts 3 Posters 1.6k 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.
  • J Offline
    JohnGalt
    last edited by May 8, 2023, 12:56 AM

    You can try the following in your custom.css file. The first 3 lines are comments, explaining what is happening. Next the background is applied to the clock module. Finally it is applied to the calendar module, with a different transparency - it produces a dark grey background.

    // background-color: rgba(red, green, blue, alpha)
    // red, green, blue: 0 - 255
    // alpha: 0 -1 (0=transparent, 1=opaque)
    .module.clock {
      background-color:rgba(0,0,0,0.4);
      border-radius:8px;
      padding:8px;
    }
    .module.calendar {
      background-color:rgba(0,0,0,0.6);
      border-radius:8px;
      padding:8px;
    }
    
    S 1 Reply Last reply May 8, 2023, 1:02 AM Reply Quote 0
    • S Online
      sdetweil @JohnGalt
      last edited by May 8, 2023, 1:02 AM

      @JohnGalt dont need .module

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      J 2 Replies Last reply May 8, 2023, 1:30 AM Reply Quote 0
      • S Online
        sdetweil @videogame95
        last edited by sdetweil May 8, 2023, 1:09 AM May 8, 2023, 1:08 AM

        @videogame95 sorry, I missed your question

        https://docs.magicmirror.builders/modules/customcss.html#target-a-specific-module

        .modulename .... { 
        .....
        }
        

        like

        .clock { 
        ...
        }
        

        applies to the stuff in the clock module output

        the .modulename … before the { is called the css selector clause… it ‘selects’ the elements the data inside the {} will apply to

        I use this to remind me of the things that can go there …
        https://www.w3schools.com/cssref/css_selectors.php

        here is a clause in my MMM-Config module form to hide a useless element I have no control over

        .possibly-hidden-tab div:nth-child(2)  > div > div >div >ul >li:only-child >a[rel*="Item 1"] {
          display: none;
        }
        

        the selector clause ALWAYS selects ALL elements in the document that match the selector… SO .modulename prefix means u only mess up your stuff!

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        1 Reply Last reply Reply Quote 0
        • J Offline
          JohnGalt @sdetweil
          last edited by May 8, 2023, 1:30 AM

          @sdetweil - Thanks! I will clean up my code some, when I get a chance. I appreciate the input.

          1 Reply Last reply Reply Quote 0
          • J Offline
            JohnGalt @sdetweil
            last edited by May 8, 2023, 1:36 AM

            @sdetweil – BTW, it this also true for all modules? That is, also for non-default modules? [Somehow I had internalized that even if default modules could be addressed this way, others required something like the following]:

            .module.MMM-WeatherAlerts header {text-align: left;
            }
            .module.MMM-WeatherAlerts {  background-color:rgba(255,255,255,0.2); 
            }
            
            
            S 1 Reply Last reply May 8, 2023, 1:37 AM Reply Quote 0
            • S Online
              sdetweil @JohnGalt
              last edited by May 8, 2023, 1:37 AM

              @JohnGalt its the same for all modules…

              .clock
              .calendar
              .MMM-Config
              whatever

              when MM puts the content in a section it adds a class (.modulename) to that block of content

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              J 1 Reply Last reply May 8, 2023, 1:38 AM Reply Quote 0
              • J Offline
                JohnGalt @sdetweil
                last edited by May 8, 2023, 1:38 AM

                @sdetweil - Great, good to know.

                S 1 Reply Last reply May 8, 2023, 1:42 AM Reply Quote 0
                • S Online
                  sdetweil @JohnGalt
                  last edited by sdetweil May 8, 2023, 1:45 AM May 8, 2023, 1:42 AM

                  @JohnGalt here is a copy out of some of the content for a weather module

                  <div class="container" style="display: block;">
                       <div id="module_5_weather" class="module weather weather">
                           <header class="module-header" style="display: none;"></header>
                             <div class="module-content">
                                 // module content would go here
                                <div class="dimmed light small"> Cargando … </div>
                            </div>
                      </div>
                  </div>
                  

                  on this line

                  <div id="module_5_weather" class="module weather weather">
                  

                  you have the modulename as a class
                  and the id “module_5_weather”
                  as the selectable elements to target the content inside
                  module_5 is the count of modules top down starting at 0
                  good if u had multiple instances of a module and wanted to target different ones for different styles

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  J 1 Reply Last reply May 24, 2023, 2:24 AM Reply Quote 0
                  • S sdetweil referenced this topic on May 8, 2023, 11:14 AM
                  • J Offline
                    JohnGalt @sdetweil
                    last edited by May 24, 2023, 2:24 AM

                    @sdetweil - Thanks Sam. This will help when I work on cleaning up my display overall, as i do have multiple instances of both calendar and weather running!

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