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

How can elements in the default weather module be moved

Scheduled Pinned Locked Moved Custom CSS
12 Posts 2 Posters 1.3k 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.
  • S Offline
    sdetweil @DDE12
    last edited by Oct 6, 2024, 4:56 PM

    @DDE12 that ::before is what makes the first elevated

    Then you have
    the temp 81
    And feels like in different spans w different styles

    I dont know how to override the before (yet)

    Sam

    How to add modules

    learning how to use browser developers window for css changes

    S 1 Reply Last reply Oct 6, 2024, 5:21 PM Reply Quote 0
    • S Offline
      sdetweil @sdetweil
      last edited by sdetweil Oct 6, 2024, 5:27 PM Oct 6, 2024, 5:21 PM

      @DDE12

      i ‘think’

      span.light.wi.weathericon.wi-day-sunny {}
      note no spaces

      because css doesn’t support widcard(*)

      you will have to make separate lines for each possible weather icon

      then on the others, you will have to make the styles produce the same results

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      S 1 Reply Last reply Oct 6, 2024, 5:42 PM Reply Quote 0
      • S Offline
        sdetweil @sdetweil
        last edited by Oct 6, 2024, 5:42 PM

        @DDE12 and if you need to style the icon more, then settings inside the {}

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        D 1 Reply Last reply Oct 7, 2024, 12:16 AM Reply Quote 0
        • D Offline
          DDE12 @sdetweil
          last edited by DDE12 Oct 7, 2024, 12:26 AM Oct 7, 2024, 12:16 AM

          @sdetweil
          In tinkering around, I am able to move it in custom.css with the following and possibly avoid addressing every individual icon.

          .weather .weathericon {
          	display: inline-block;
          	transform: translate(-31px, -32px) !important;
          	outline: 1px solid blue;
          }
          

          The problem with what I have above is that it will only make it look okay on one screen resolution. How do I move it to the top left of the module space so that it is relative (stays in the top left regardless of screen resolution).

          S 1 Reply Last reply Oct 7, 2024, 12:29 AM Reply Quote 0
          • S Offline
            sdetweil @DDE12
            last edited by Oct 7, 2024, 12:29 AM

            @DDE12 you can try

            position:relative;
            top:0;
            left:0;

            that will put the selected thing top left of its parent

            you may have to play w the selector

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            D 1 Reply Last reply Oct 8, 2024, 12:53 AM Reply Quote 0
            • D Offline
              DDE12 @sdetweil
              last edited by Oct 8, 2024, 12:53 AM

              @sdetweil
              I’ve made some headway with the temperatures but the icon is not behaving. I think part of the problem is that it is being treated as a font or the original icon that is a font is hanging around causing a problem. It there a way with the CSS to clear all the settings and remove the font setting for the icon container?

              S 1 Reply Last reply Oct 8, 2024, 12:56 AM Reply Quote 0
              • S Offline
                sdetweil @DDE12
                last edited by Oct 8, 2024, 12:56 AM

                @DDE12 I do not know. this ::before is likely the problem.

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                D 1 Reply Last reply Oct 8, 2024, 8:49 PM Reply Quote 0
                • D Offline
                  DDE12 @sdetweil
                  last edited by Oct 8, 2024, 8:49 PM

                  @sdetweil
                  I have made some progress. I commented out everything in vendor\node_modules\weathericons\css\weather-icons.css. and changed .weather . larger to flex and have more control of the icon.

                  .weather .large {
                      line-height: 1;
                      display: flex;
                  }
                  
                  .weather .weathericon {
                  	font-size: unset !important;
                          line-height: unset !important;
                  	transform: unset !important;
                  	outline: 1px solid blue;
                  	width: 2em !important;
                  	height: 2em !important;
                  	position:relative;
                  	top: -18px;
                  	left: -15px;
                  }
                  
                  .weather .light.bright {
                  	outline: 1px solid green;
                  	position:absolute;
                  	top: 2px;
                  	left: 147px;
                  }
                  
                  .weather .normal.medium.feelslike {
                  	outline: 1px solid purple;
                  	position:absolute;
                  	top: 3px;
                  	left: 242px;
                  }
                  

                  Current cond.JPG

                  The icons in this set have a lot of background “dead space” so it is skewed up and left to get it to the corner. The height of the module space is being controlled by the height of the icon. How can I decrease the height of the module space by the amount I moved the icon up plus a little extra for the dead space?

                  S 1 Reply Last reply Oct 8, 2024, 10:02 PM Reply Quote 0
                  • S Offline
                    sdetweil @DDE12
                    last edited by Oct 8, 2024, 10:02 PM

                    @DDE12 make the icon 1.5em
                    then you need to size the div the spans are in

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

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