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.

    organization of the text next to the icon.

    Scheduled Pinned Locked Moved Custom CSS
    48 Posts 3 Posters 23.5k Views 5 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.
    • D Offline
      doubleT Module Developer
      last edited by

      If you want to work in the code and are not afraid that an update might overwrite it, you could try to change

      		// Name
      		newCell = newrow.insertCell(1);
      		newText = document.createTextNode(name);
      		newCell.appendChild(newText);
      

      to

      		// Name
      		newCell = newrow.insertCell(1);
      		newCell.className = "align-left";
      		newText = document.createTextNode(name);
      		newCell.appendChild(newText);
      

      That seems to be what’s aligning the icon cell to the left. That css comes from MM’s main.css.

      1 Reply Last reply Reply Quote 0
      • I Offline
        iorifly
        last edited by iorifly

        I will try to locate this code.

        in which module file do I look for it?

        1 Reply Last reply Reply Quote 0
        • D Offline
          doubleT Module Developer
          last edited by

          MMM-homeassistant-sensors.js

          1 Reply Last reply Reply Quote 0
          • I Offline
            iorifly
            last edited by

            @doubleT said in organization of the text next to the icon.:

            newCell = newrow.insertCell(1);
            newCell.className = “align-left”;
            newText = document.createTextNode(name);
            newCell.appendChild(newText);

            alignment resolved. Can I now create lines to separate groups? Or is it impossible?

            1 Reply Last reply Reply Quote 0
            • D Offline
              doubleT Module Developer
              last edited by doubleT

              Ok, please keep in mind that this is not the best solution (working directly in the code).

              If you want to make the changes via custom.css file, try this:

              (Now, since the module is called “MMM-homeassistant-sensors” I’m going to assume the element is identifiable with _“.module.MMM-homeassistant-sensors” …)

              Tell each 2nd cell to align its content left:

              .module.MMM-homeassistant-sensors table tr td:nth-of-type(2) {
                  text-align: left;
              }
              

              Tell the cells of the 3rd and 6th line to have a bottom border line:

              .module.MMM-homeassistant-sensors table tr:nth-of-type(3) td,
              .module.MMM-homeassistant-sensors table tr:nth-of-type(6) td {
                  border-bottom: 1px solid white;
              }
              

              If the line is separated, try:

              .module.MMM-homeassistant-sensors table {
                  border-spacing: 0;
              }
              

              EDIT: There was an error, it’s text-align, of course. Not test-align.

              1 Reply Last reply Reply Quote 0
              • I Offline
                iorifly
                last edited by

                Let me see if I got it. I need to change the custom.css file. Where is it located?

                in the css folder. I only have the main.css file

                1 Reply Last reply Reply Quote 0
                • D Offline
                  doubleT Module Developer
                  last edited by

                  Create a file named “custom.css” and put the code from above inside it.

                  1 Reply Last reply Reply Quote 0
                  • I Offline
                    iorifly
                    last edited by

                    @doubleT said in organization of the text next to the icon.:

                    .module.MMM-homeassistant-sensors table {
                    border-spacing: 0;
                    }

                    nothing happened. This is the same way. He did not create the lines.

                    S 1 Reply Last reply Reply Quote 0
                    • D Offline
                      doubleT Module Developer
                      last edited by

                      Yeeeeah … what about the one above that? The 2nd part. ;)

                      I 1 Reply Last reply Reply Quote 0
                      • S Do not disturb
                        sdetweil @iorifly
                        last edited by

                        @iorifly take the .module prefix off, not needed

                        Sam

                        How to add modules

                        learning how to use browser developers window for css changes

                        I 1 Reply Last reply Reply Quote 0
                        • I Offline
                          iorifly @sdetweil
                          last edited by

                          @sdetweil ok

                          1 Reply Last reply Reply Quote 0
                          • I Offline
                            iorifly @doubleT
                            last edited by

                            @doubleT

                            excuse. LOL

                            I did not understand.

                            1 Reply Last reply Reply Quote 0
                            • D Offline
                              doubleT Module Developer
                              last edited by

                              The content of the custom.css should be:

                              .module.MMM-homeassistant-sensors table tr td:nth-of-type(2) {
                                  test-align: left;
                              }
                              .module.MMM-homeassistant-sensors table tr:nth-of-type(3) td,
                              .module.MMM-homeassistant-sensors table tr:nth-of-type(6) td {
                                  border-bottom: 1px solid white;
                              }
                              .module.MMM-homeassistant-sensors table {
                                  border-spacing: 0;
                              }
                              

                              All of it. Not just the last part.

                              1 Reply Last reply Reply Quote 0
                              • I Offline
                                iorifly
                                last edited by

                                @doubleT said in organization of the text next to the icon.:

                                .module.MMM-homeassistant-sensors table tr td:nth-of-type(2) {
                                test-align: left;
                                }
                                .module.MMM-homeassistant-sensors table tr:nth-of-type(3) td,
                                .module.MMM-homeassistant-sensors table tr:nth-of-type(6) td {
                                border-bottom: 1px solid white;
                                }
                                .module.MMM-homeassistant-sensors table {
                                border-spacing: 0;
                                }

                                .MMM-homeassistant-sensors table tr td:nth-of-type(2) {
                                    test-align: left;
                                }
                                
                                .MMM-homeassistant-sensors table tr:nth-of-type(3) td,
                                .module.MMM-homeassistant-sensors table tr:nth-of-type(6) td {
                                    border-bottom: 1px solid white;
                                }
                                
                                .MMM-homeassistant-sensors table {
                                    border-spacing: 0;
                                }
                                
                                
                                1 Reply Last reply Reply Quote 0
                                • D Offline
                                  doubleT Module Developer
                                  last edited by

                                  @sdetweil I don’t have any modules with uper case letters (MMM- …) at the moment. Can you confirm the module class name is with uper case letters or is it changed to lower case?

                                  In this situation, with a unique module name, it’s ok to identfy the module without the .module but in general I’d say it’s best practice that if you want to address a specific module, you describe it as precise as possible.
                                  E.g. there might be a module “image_frame” that you want to address but there’s also a module that somewhere within its structure has one div with the class “image_frame” that you don’t want to address. Then it’s absolutely necessary to address the target with .module.image_frame

                                  1 Reply Last reply Reply Quote 0
                                  • I Offline
                                    iorifly
                                    last edited by

                                    added “.modulo” before .MMM

                                    1 Reply Last reply Reply Quote 0
                                    • D Offline
                                      doubleT Module Developer
                                      last edited by

                                      And that worked? :thinking_face:

                                      1 Reply Last reply Reply Quote 0
                                      • I Offline
                                        iorifly
                                        last edited by

                                        @doubleT

                                        I noticed that the font color is erased. Why that ? the other modules have the strongest colors!

                                        1 Reply Last reply Reply Quote 0
                                        • D Offline
                                          doubleT Module Developer
                                          last edited by

                                          Because the creator of that module gave the wrapper the class name “dimmed” in line 38 …

                                          I 1 Reply Last reply Reply Quote 0
                                          • I Offline
                                            iorifly
                                            last edited by

                                            @doubleT Unfortunately not.

                                            1 Reply Last reply Reply Quote 0

                                            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                            With your input, this post could be even better 💗

                                            Register Login
                                            • 1
                                            • 2
                                            • 3
                                            • 1 / 3
                                            • 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