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.

    Help with CSS not showing changes on MMM-CalendarExt2

    Scheduled Pinned Locked Moved Solved Development
    11 Posts 5 Posters 4.1k 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.
    • 4 Offline
      44mc44
      last edited by

      Success!
      removing ‘body{}’ took care of it.
      Appreciate the help!

      1 Reply Last reply Reply Quote 0
      • Mykle1M Offline
        Mykle1 Project Sponsor Module Developer @44mc44
        last edited by

        @44mc44 said in Help with CSS not showing changes on MMM-CalendarExt2:

        There is only one custom.css file correct?

        That is correct. It might not be a bad idea to make a backup as you add to it. You never know. :-)

        Create a working config
        How to add modules

        1 Reply Last reply Reply Quote 0
        • 4 Offline
          44mc44
          last edited by

          Definitely will do. :thumbs_up:

          1 Reply Last reply Reply Quote 0
          • S Offline
            Seann Module Developer @44mc44
            last edited by

            @44mc44 Just a suggestion, but you may want to do some research on css using w3 schools or something. The way you attempted to create your css would only work using scss. In standard css you can’t nest the declaration of styles inside of each other. (Not sure how to word it, although i’m pretty certain declaration of styles is wrong.)

            4 1 Reply Last reply Reply Quote 0
            • 4 Offline
              44mc44 @Seann
              last edited by

              @seann Will check it out. Thanks! This is all really new to me. I read through the CSS 101 in this forum, but I could definitely use more help.

              1 Reply Last reply Reply Quote 1
              • J Offline
                j.e.f.f Project Sponsor Module Developer
                last edited by

                For a bit of background on this, nesting CSS as @44mc44 has tried to do (known as “CSS scoping”) was proposed for the CSS spec, but browsers were slow to support it, and eventually dropped it altogether.

                The idea was you could just limit your CSS to a certain selector like follows:

                .some-class {
                  h1 {
                    font-size: 24px;
                    color: #ACACAC;
                  }
                
                  p {
                    font-size: 18px;
                  }
                }
                

                This would mean that h1 and p elements inside an element with the class some-class would have the styles applied, while h1 and p elements that are not contained in that class would not. This would be a safer way to write your CSS to ensure it doesn’t accidentally get applied to unintended elements.

                Unfortunately, this doesn’t work in any browser, so you have to write out the rules individually to achieve the same thing:

                .some-class h1 {
                  font-size: 24px;
                  color: #ACACAC;
                }
                
                .some-class p {
                  font-size: 18px;
                }
                

                @Seann is correct in that if we were using a preprocessor such as SASS or SCSS, then scoping would indeed be supported. You would write your rules scoped, and then the preprocessor would take care of converting your rules to the long form. Using a preprocessor helps to make authoring your CSS easier and less verbose. Alas, Magic Mirror does not appear to use a CSS preprocessor, so we’re stuck with writing it out the long way.

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