Automatic Light Mode ⚡ Dark Mode Switcher for GeneratePress (the super-simple way!)

Sdílet
Vložit
  • čas přidán 2. 07. 2023
  • In this video, I'm going to show you how you can use the "prefers color scheme" CSS media feature to create an automatic light mode / dark mode switch on your GeneratePress website.
    Here's the code you need:
    @media (prefers-color-scheme: dark) {
    /* put your root color declarations here */
    }
    [ Video Created and Produced by Kyle Van Deusen ]
    👏 COMMUNITY
    Join our free community: theadminbar.com/group/
    (voted best WordPress community!):
    🔴 EVENTS
    See past and upcoming live interviews & workshops: theadminbar.com/events/
    🎁 PRODUCTS
    Sell more care plans with The Website Owner's Manual: theadminbar.com/products/wom/
    Write proposals in less than 15 minutes with this template: theadminbar.com/products/easy...
    Fill your prospect pipeline in this 3-week challenge: theadminbar.com/products/pros...
    5 Airtable templates I use to run my agency: theadminbar.com/products/agen...
    📨 NEWSLETTER
    Stay up-to-date with the best from in and around The Admin Bar: theadminbar.com/friday-chaser/
    🤖 MISC
    Visit our website: theadminbar.com
    Product endorsements: theadminbar.com/products/#end...
    Kyle on Twitter: / kylevandeusen

Komentáře • 28

  • @javaidnayk
    @javaidnayk Před rokem +1

    Neat and simple solution. A switcher would be a great addition

  • @bluefuzecom
    @bluefuzecom Před 10 měsíci

    love it! Great solution. And as you asked to do, I would definitely love to see another vid about a "switcher" in the future.

  • @carolmaI1mn
    @carolmaI1mn Před rokem

    Thanks for the great video Kyle! Yeah would great to see a switch solution!

  • @upstatenyrider8413
    @upstatenyrider8413 Před 11 měsíci +1

    Thanks Kyle - really helpful. Would really like the follow-up with the switcher solution. There are plugins out there for this, but it has to be fairly straightforward. Would appreciate seeing your approach to JS in GP. I have a hunch it can be accomplished with elements - and if so, that opens a world of possibilities. Actually, you may wish to consider a JS video in GP, and using the dark mode switcher as a good example.

    • @TheAdminBar
      @TheAdminBar  Před 11 měsíci +2

      Thanks! I did get the switcher working, but I need to get someone to help me make sure the JS is optimized. It's on my list!

  • @gojiyaravi2
    @gojiyaravi2 Před rokem

    😊 Thanks Kyle.

  • @trtofficialurdu2380
    @trtofficialurdu2380 Před rokem

    Hello Sir,
    Nice video, please continue making these types of videos.

  • @iamjoshkoop
    @iamjoshkoop Před rokem

    Well done and bah humbug to 4th July hurting this as it’s now time to go play!

  • @tygoro
    @tygoro Před rokem

    been waiting for this one, very excited for the toggle switcher code

    • @TheAdminBar
      @TheAdminBar  Před rokem +2

      Ohhh I've been working on this and it's REALLY freaking slick!

  • @halilgungormus
    @halilgungormus Před rokem +1

    This is awesome! We definitely would like to see switcher solution. Thanks Kyle!

    • @TheAdminBar
      @TheAdminBar  Před rokem +4

      Sweeet! I'm going to try and make something simpler (yet more capable) than what I have done in the past.

    • @halilgungormus
      @halilgungormus Před rokem

      @@TheAdminBar cant wait to use it on my blog! Huuuge thanks Kyle!

    • @halilgungormus
      @halilgungormus Před rokem

      @@TheAdminBar can we have a hope to see this dark mode toggle in the near future Kyle? I'm checking on your channel everyday :)

  • @landonporter77
    @landonporter77 Před rokem

    Yes!

    • @TheAdminBar
      @TheAdminBar  Před rokem +1

      I thought you might like this one! :) This really is a SIMPLE way to do it.

  • @halilgungormus
    @halilgungormus Před 10 měsíci +1

    @theadminbar I'm just trying my chance again :) is it possible to see toggle switch option for this Kyle?

    • @TheAdminBar
      @TheAdminBar  Před 10 měsíci

      I came up with the whole solution, but at some point I nuked the install 😭 Just haven't had the motivation to do all that work again 😭

    • @halilgungormus
      @halilgungormus Před 10 měsíci

      @TheAdminBar your channel is the only channel that I follow for WordPress and GP&GB stuff. How about this for motivation? :) thanks for all the works you've done

  • @badcatdesign
    @badcatdesign Před rokem

    Cool cool cool.. thanks. So yeah, let's see the GP way to handle the JS Switcher.

  • @RossrivalBendillo
    @RossrivalBendillo Před rokem

    Can we put an additional element or a toggler? to switch

    • @TheAdminBar
      @TheAdminBar  Před 11 měsíci

      Yeah, it can be done. I got it working shortly after this video but there didn't seem to be much interest.

    • @bitkahuna
      @bitkahuna Před 10 měsíci

      yes would like to see toggle for this, however i guess that means the toggle then overrides the system mode ?!

  • @BrandonLaskowski
    @BrandonLaskowski Před rokem

    This is literally the only thing I can think of I’ve felt GP is missing. Should be common theme practice by now right?

    • @TheAdminBar
      @TheAdminBar  Před rokem +1

      It does seem quite popular! But this makes it pretty darn simple. I may just start setting up my sites with this in mind from the beginning.

    • @BrandonLaskowski
      @BrandonLaskowski Před rokem

      @@TheAdminBar thanks I’m goi g to give it a shot.

  • @ranjeetkumarsingh9667

    awesome. [lease make video on toggle switch using JS. waiting for next video.