Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Lay Theme Forum

  1. Home
  2. General Discussion
  3. burger/menu dynamic color adaptation

burger/menu dynamic color adaptation

Scheduled Pinned Locked Moved General Discussion
9 Posts 4 Posters 111 Views
  • 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.
  • M Offline
    M Offline
    mr.do
    wrote on Jan 5, 2025, 10:28 AM last edited by mr.do Jan 5, 2025, 5:29 AM
    #1

    Hello everyone,

    I recently came across a website built with LayTheme (https://prideof.london) that has an interesting feature: the burger menu icon automatically adjusts its color based on the background - appearing light on dark backgrounds and dark on light backgrounds when viewed on mobile.

    I assume this effect is achieved through custom CSS. How? Would it also be possible to implement the same dynamic color adaptation for desktop menu items as well?

    Thank you for your help, and happy new year to all!
    mr.do

    burger-lay.jpg

    1 Reply Last reply
    0
    • F Offline
      F Offline
      felix_rabe
      wrote on Jan 6, 2025, 1:38 PM last edited by
      #2

      @mr-do this effect is called "mix-blend-mode" with the setting "difference" and a white color for the icon that you can apply with custom css.

      1 Reply Last reply
      1
      • A Offline
        A Offline
        arminunruh
        Global Moderator
        wrote on Jan 6, 2025, 4:01 PM last edited by
        #3

        yes very good @felix_rabe !

        for page overlay burger:

        .standard-overlay-burger{
           mix-blend-mode: difference !important;
           /*if your icon is black, use this:*/
           filter: invert(100%);
        }
        

        for desktop nav:

        .desktop-nav{
           mix-blend-mode: difference !important;
           /*if your icon is black, use this:*/
           filter: invert(100%);
        }
        

        for desktop site title:

        .sitetitle{
           mix-blend-mode: difference !important;
           /*if your icon is black, use this:*/
           filter: invert(100%);
        }
        
        O 1 Reply Last reply 27 days ago
        1
        • M Offline
          M Offline
          mr.do
          wrote on Jan 7, 2025, 7:55 AM last edited by
          #4

          you guys are the best - thanks <3

          1 Reply Last reply
          1
          • A arminunruh
            Jan 6, 2025, 4:01 PM

            yes very good @felix_rabe !

            for page overlay burger:

            .standard-overlay-burger{
               mix-blend-mode: difference !important;
               /*if your icon is black, use this:*/
               filter: invert(100%);
            }
            

            for desktop nav:

            .desktop-nav{
               mix-blend-mode: difference !important;
               /*if your icon is black, use this:*/
               filter: invert(100%);
            }
            

            for desktop site title:

            .sitetitle{
               mix-blend-mode: difference !important;
               /*if your icon is black, use this:*/
               filter: invert(100%);
            }
            
            O Offline
            O Offline
            OLVVDB
            wrote 27 days ago last edited by
            #5

            @arminunruh

            I'm trying to apply a "difference" blending mode for the mobile version of my site, specifically to a custom SVG burger icon. However, I can't get it to work. I'm also unsure how to properly target the site title on mobile to apply the same effect.

            The "difference" blending mode works perfectly on the desktop version, but not on mobile so far.

            https://www.remkovanderauwera.com/

            F 1 Reply Last reply 26 days ago
            0
            • O OLVVDB
              27 days ago

              @arminunruh

              I'm trying to apply a "difference" blending mode for the mobile version of my site, specifically to a custom SVG burger icon. However, I can't get it to work. I'm also unsure how to properly target the site title on mobile to apply the same effect.

              The "difference" blending mode works perfectly on the desktop version, but not on mobile so far.

              https://www.remkovanderauwera.com/

              F Offline
              F Offline
              felix_rabe
              wrote 26 days ago last edited by felix_rabe 27 days ago
              #6

              @OLVVDB for mobile its .mobile-title{ ... } etc. use the inspection tool of your browser to find the classes. and I would dramatically decrease the size and quality of the thumbnail videos. the frontage has a load of over 100 MB. https://handbrake.fr is a good app for that.

              O 1 Reply Last reply 25 days ago
              0
              • F felix_rabe
                26 days ago

                @OLVVDB for mobile its .mobile-title{ ... } etc. use the inspection tool of your browser to find the classes. and I would dramatically decrease the size and quality of the thumbnail videos. the frontage has a load of over 100 MB. https://handbrake.fr is a good app for that.

                O Offline
                O Offline
                OLVVDB
                wrote 25 days ago last edited by OLVVDB 25 days ago
                #7

                @felix_rabe allright thanks for informing me about the heavy page load. need to take care of that. as for the custom burger Icon I was able to find the class but the blending mode does not seem to work on the SVG files i uploaded in the custom icons. I exported the SVGs as styling = presentation attributes and its object IDs as minimal and decimals: 2, responsive from illustrator. Is there something I am doing wrong here or is this a knows issue that blending modes might not work on custom SVG files?

                this is the CSS i used:

                /* Mobile burger menu icon blend */
                .mobile-menu-icon {
                mix-blend-mode: exclusion;
                filter: invert(100%);
                }

                F 1 Reply Last reply 24 days ago
                0
                • O OLVVDB
                  25 days ago

                  @felix_rabe allright thanks for informing me about the heavy page load. need to take care of that. as for the custom burger Icon I was able to find the class but the blending mode does not seem to work on the SVG files i uploaded in the custom icons. I exported the SVGs as styling = presentation attributes and its object IDs as minimal and decimals: 2, responsive from illustrator. Is there something I am doing wrong here or is this a knows issue that blending modes might not work on custom SVG files?

                  this is the CSS i used:

                  /* Mobile burger menu icon blend */
                  .mobile-menu-icon {
                  mix-blend-mode: exclusion;
                  filter: invert(100%);
                  }

                  F Offline
                  F Offline
                  felix_rabe
                  wrote 24 days ago last edited by felix_rabe 25 days ago
                  #8

                  I would make the svg white by file, not by filter.

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    arminunruh
                    Global Moderator
                    wrote 21 days ago last edited by
                    #9

                    Oh, thanks for the great answers Felix. Yeah, I too think the SVG needs to be white. And then remove the filter invert.

                    1 Reply Last reply
                    1
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    I also code custom websites or custom Lay features.
                    💿 Email me here: 💿
                    info@laytheme.com

                    Before you post:
                    1. When using a WordPress Cache plugin, disable it or clear your cache.
                    2. Update Lay Theme and all Lay Theme Addons
                    3. Disable all Plugins
                    4. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"

                    This often solves issues you might run into

                    When you post:
                    1. Post a link to where the problem is
                    2. Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
                    3. If the problem is difficult to explain, post screenshots / link to a video to explain it
                    Online Users
                    Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com
                    laytheme.com
                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Search