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

organization of the text next to the icon.

Scheduled Pinned Locked Moved Custom CSS
48 Posts 3 Posters 18.0k 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.
  • S Away
    sdetweil
    last edited by Jan 18, 2020, 7:26 PM

    text alignment, you will have to change the code. the author did not provide element classes you could modify with css. (see the code from one of my prior posts, he just set style to ‘align-left’ or ‘align-right’ or let it default (text nodes align right by default for ltr languages)

    adding a line under some entries,
    you will have to modify the code to add that capability

    Sam

    How to add modules

    learning how to use browser developers window for css changes

    1 Reply Last reply Reply Quote 0
    • D Offline
      doubleT Module Developer
      last edited by Jan 18, 2020, 7:27 PM

      It can be done in css even if there are no class names. Give me a minute.

      1 Reply Last reply Reply Quote 0
      • I Offline
        iorifly
        last edited by Jan 18, 2020, 7:29 PM

        Thanks! I’m in no hurry. Even because it took me a long time to get here. sdetweil helped me extremely.

        Thank you very much for all your support! sensational you !!!.

        1 Reply Last reply Reply Quote 0
        • D Offline
          doubleT Module Developer
          last edited by Jan 18, 2020, 7:35 PM

          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 Jan 18, 2020, 7:37 PM Jan 18, 2020, 7:36 PM

            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 Jan 18, 2020, 7:38 PM

              MMM-homeassistant-sensors.js

              1 Reply Last reply Reply Quote 0
              • I Offline
                iorifly
                last edited by Jan 18, 2020, 7:41 PM

                @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 Jan 18, 2020, 8:34 PM Jan 18, 2020, 7:55 PM

                  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 Jan 18, 2020, 7:57 PM

                    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 Jan 18, 2020, 7:58 PM

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

                      1 Reply Last reply Reply Quote 0
                      • 1
                      • 2
                      • 3
                      • 4
                      • 5
                      • 2 / 5
                      2 / 5
                      • First post
                        18/48
                        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