mjml icon indicating copy to clipboard operation
mjml copied to clipboard

Navbar without hamburger unnecessary css

Open Stelu77 opened this issue 1 year ago • 2 comments

Describe the bug When using the mj-navbar without hamburger menu there are still a large CSS block rendered in the head for the menu feature.

To Reproduce Try it out sample

Expected behavior This css block should only be rendered in HTML if hamburger attribute are set.

<style type="text/css">
    noinput.mj-menu-checkbox {
      display: block !important;
      max-height: none !important;
      visibility: visible !important;
    }

    @media only screen and (max-width:480px) {
      .mj-menu-checkbox[type="checkbox"]~.mj-inline-links {
        display: none !important;
      }

      .mj-menu-checkbox[type="checkbox"]:checked~.mj-inline-links,
      .mj-menu-checkbox[type="checkbox"]~.mj-menu-trigger {
        display: block !important;
        max-width: none !important;
        max-height: none !important;
        font-size: inherit !important;
      }

      .mj-menu-checkbox[type="checkbox"]~.mj-inline-links>a {
        display: block !important;
      }

      .mj-menu-checkbox[type="checkbox"]:checked~.mj-menu-trigger .mj-menu-icon-close {
        display: block !important;
      }

      .mj-menu-checkbox[type="checkbox"]:checked~.mj-menu-trigger .mj-menu-icon-open {
        display: none !important;
      }
    }
  </style>

MJML environment (please complete the following information): Try it out editor.

Stelu77 avatar Mar 28 '24 07:03 Stelu77

😬 that's really interesting to fix but with current implem I don't think we can fix it yet...

Keeping this open if anyone willing to work on this.

Nice finding!

iRyusa avatar Apr 09 '24 11:04 iRyusa