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

CSS - Naming header to change?

Scheduled Pinned Locked Moved Troubleshooting
4 Posts 2 Posters 2.1k 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.
  • D Offline
    Damian
    last edited by yawns Apr 19, 2018, 6:37 PM Apr 19, 2018, 2:28 PM

    Hi, I have managed to change a few things in my Sonos module using CSS, but stuck at what name I should use for the Header in order to change it’s color, and increase the font a little.
    Can anyone advise what I should be naming it? There is nothing in the module read me to suggest changing anything about the header through CSS, just being able to change the name in the config.js obviously.

    I tried a few variations, but not sure if header still uses the same styling as the other parts that I managed to edit?

    Thanks

    {
    	module: 'MMM-Sonos',
    	header: "Playing on SONOS",
    	position: "top_center", // This can be any of the regions, best results in center regions
    	classes: "default everyone",
    	config: {
    		// See 'Configuration options' for more information.
    	}
    }
    
    }
    .sonos ul .type {
        font-size: 18px;
        padding: 0px 0px;
        line-height: 12px;
        width: 260px;
        color: red;
    }
    .sonos ul .room {
        font-size: 20px;
        padding: 0px 0px;
        line-height: 16px;
        width: 260px;
        color: blue;
    }
    .sonos ul .song {
        padding: 0px 0px;
        position: relative;
    }
    .sonos ul .art img {
        height: 60px;
        width: 60px;
        border-radius: 50%;
        margin: 0px 0px;
        border: 2px solid #FFF;
    }
    .sonos ul .name {
        width: 200px;
        font-size: 20px;
        padding: 0px 4px;
        line-height: 16px;
        color: yellow;
    }
    .sonos ul .header {
       color: blue;
    }
    .sonos ul .header {
       text-color-blue
    
    D 1 Reply Last reply Apr 23, 2018, 3:53 PM Reply Quote 0
    • D Offline
      Damian @Damian
      last edited by Apr 23, 2018, 3:53 PM

      .MMM-Sonos header {
      Color: #ff00ff;
      
      M 1 Reply Last reply Apr 23, 2018, 8:20 PM Reply Quote 2
      • M Offline
        Mykle1 Project Sponsor Module Developer @Damian
        last edited by Apr 23, 2018, 8:20 PM

        @Damian

        So, why don’t you tell others how you found your answer? It may help them in a similar situation. :-)

        Create a working config
        How to add modules

        D 1 Reply Last reply Apr 24, 2018, 10:25 AM Reply Quote 1
        • D Offline
          Damian @Mykle1
          last edited by Damian Apr 24, 2018, 10:40 AM Apr 24, 2018, 10:25 AM

          @Mykle1 said in CSS - Naming header to change?:

          @Damian

          So, why don’t you tell others how you found your answer? It may help them in a similar situation. :-)

          Was in a rush so just posted the answer for others…

          Ok, I was directed to open Terminal, into $ MagicMirrror, and run my mirror with

          npm start dev
          

          Which will open up the Console window on the right of MM main screen.
          Then click the element tab at the top of the dev console window.
          On the left you will see the regions of your mirror.
          You have to click through them to find the module you are interested in, then click through that to find the header element.

          There you will find the class of the header. Take that to your custom.css file and apply. It’s case sensitive to the name of the module.

          This is what I did… as I have never been there before as never had cause to, so wanted to see it anyway.
          But, the real way I found the answer to my mistake, was seeing an example given by @Mykle1 of what I may find, and how to then format the .HEADER.CLASS.NAME into my CSS…

          .MMM-WWI .HEADER.CLASS.NAME {
            color: green;               /* Header color. */
            text-align: right;           /* Algin header text. left, center, right  */
          }
          

          As soon as I saw .MMM-WWI I realised straight away that I was trying to copy the other examples of ,sonos that works by changing the other sonos module parts - Zone - Album art - Track name, and I should have used .MMM-Sonos for the header…

          My mistakes were obvious when I see them now… Not using a Dot at the start of MMM… then using .sonos and ,Sonos, when it should have been -Sonos… using .header when no Dot was rrequired.

          I now intend finding a list of MM CSS commands, and looking at them, and playing about with them so things like that (That I do not normaly play around with at all) will be understood more, and will prompt me more to playing around more in that part - customising.

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