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.

    Clock Module - Adjust light time to avoid line break

    Scheduled Pinned Locked Moved Custom CSS
    8 Posts 3 Posters 527 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.
    • R Offline
      rkorell
      last edited by rkorell

      Dear all,
      I’ve tried desparately the developer’s console to figure it out and tried to get hints in given postings but no luck…
      Since days become longer the day time is written with more letters and so I see a line wrap in the day time of clock module (in this example 11h17m)::
      Screenshot 2025-05-27 101233.png

      Can please anybody help me with aligning this?
      Developers console is nearly unusable because I have an anaolog clock and the transformation hits every second and destroys focus.
      I’ve menaged at least to get the HTML at this section:

      <div class="module-content">
          <div class="clock-grid clock-grid-bottom">
              <div class="clock-circle" style="width: 200px; height: 200px; background: url(&quot;modules/default/clock/faces/face-001.svg&quot;) 0% 0% / 100%; border: rgba(0, 0, 0, 0.1);">
                  <div class="clock-face">
                      <div id="clock-hour" class="clock-hour" style="transform: rotate(388.208deg);"></div>
                      <div id="clock-minute" class="clock-minute" style="transform: rotate(338.5deg);"></div>
                      <div id="clock-second" class="clock-second" style="transform: rotate(150deg); background-color: rgb(220, 20, 60);"></div>
                  </div>
              </div>
              <div class="digital">
                  <div class="date normal medium">Dienstag, 27. Mai 2025</div>
                  <div class="sun dimmed small"><span class="bright"><i class="fas fa-sun" aria-hidden="true"></i> 11h 33m</span><span><i class="fas fa-arrow-up" aria-hidden="true"></i> 05:33</span><span><i class="fas fa-arrow-down" aria-hidden="true"></i> 21:30</span></div>
                  <div class="week dimmed medium">22. Kalenderwoche</div>
              </div>
          </div>
      </div>
      

      But I’m not able to figure out the correct classifier.
      The “easy” approach

      .clock .module-content {
      width: 300;
      }
      

      doesn’t work.
      Any idea?

      Thanks a LOT!
      Warm regards,
      Ralf

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

        @rkorell I think if you set

        .clock .digital {
           width: 400px;
        }
        

        using the sample config plus the showMoon/showSun true
        displaySeconds:false
        Screenshot at 2025-05-27 20-08-45.png

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        R 1 Reply Last reply Reply Quote 0
        • R Offline
          rkorell @sdetweil
          last edited by

          @sdetweil Dear Sam,
          as always: You’re right! This works.

          Thanks a lot.

          Today in the morning (before reading your post/suggestion) I’ve found

          .clock .module-content span.bright {
          color: yellow;
          }
           
          

          Interesting enough a width attribute is not working at this identifier - color works…

          Warmest regards,
          Ralf

          S 2 Replies Last reply Reply Quote 0
          • S Away
            sdetweil @rkorell
            last edited by

            @rkorell you dont need the .module_content

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            R 1 Reply Last reply Reply Quote 0
            • R Offline
              rkorell @sdetweil
              last edited by

              @sdetweil Dear Sam,
              you are sooo good.
              And so right!

              Thanks again!

              Ralf

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

                @rkorell span lives inside a div. It does not inherit the div’s size. Good thing else everything would be squished in the div

                Your css says

                For ALL elements with clock as a class (and descendants)
                ALL span elements with the class bright
                Should have the color style set to yellow for the spans text content

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                1 Reply Last reply Reply Quote 0
                • D Offline
                  dathbe
                  last edited by

                  I use the following in my css to solve this:

                  .clock .sun {
                    white-space: nowrap;
                  }
                  
                  .clock .fas {
                    padding-left: 10px;
                  }
                  

                  The second part isn’t strictly necessary, but I find it gives some needed space between the elements

                  R 1 Reply Last reply Reply Quote 0
                  • R Offline
                    rkorell @dathbe
                    last edited by

                    @dathbe this is a cool idea!
                    Thanks.
                    Ralf

                    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 Sam, technical setup by Karsten.
                    This forum is using NodeBB as its core | Contributors
                    Contact | Privacy Policy