How to Create a Dynamic Centered Logo Menu in Bricks (w/ SCSS)

Поділитися
Вставка
  • Опубліковано 2 лют 2025

КОМЕНТАРІ • 129

  • @VerbiVeritatis
    @VerbiVeritatis 2 роки тому +5

    Ha! Love the Terry cameo!
    The tutorial was great. I love walking through the theory. You’re a fantastic teacher

  • @kolsongar
    @kolsongar 2 роки тому +11

    This taught me about SCSS in less than an hour than a full on course I am doing on Udemy. Great work as usual Kevin. Keep it up!!!!!.

  • @andrebaum9248
    @andrebaum9248 2 роки тому

    Slowly starting to not feel like a chump anymore.
    Your videos introduce advanced concepts of CSS understandable for beginners, which is very valuable.
    None of the "you got to learn all the basics (basically chump-ways) first so then after that you can learn how to intelligently dump the basics" bs.

  • @davidwalls2304
    @davidwalls2304 2 роки тому +1

    Kevin, I watched this video when you first posted but came back to watch a second time. Although my client's websites generally do not add/subtract pages, this approach is definitely a more streamlined approach. Keep up the SCSS videos, they are greatly valued!

  • @mikkey0001
    @mikkey0001 2 роки тому +2

    This hit the sweet spot for me. I know basic CSS, this opened my eyes to new possibilities. More please Kevin

  • @anaf4072
    @anaf4072 2 роки тому +1

    Thanks! YES, it did help. Yes, it made perfect sense. Yes, it's absolutely worth a bit of extra time to do it right. It can safe enormous amount of time troubleshooting/adjusting. Tutorials like this one are the top notch. More, please.

  • @firozfaizan
    @firozfaizan 2 роки тому

    First time I feel confident to use SCSS. Your content rocks.

  • @bluefuzecom
    @bluefuzecom 2 роки тому +1

    You were extra "SASSY" in this video. Love it.

  • @digitalrefreshmkt
    @digitalrefreshmkt 2 роки тому

    Every video you make continues to blow us away. Loving all of these 'chump' examples and killer SCSS domination.

  • @FernandoArbex
    @FernandoArbex 2 роки тому

    You're just elevate our game to the next level. This a serious professionalism.
    Thank you for the video.

  • @prokopko
    @prokopko 2 роки тому

    This is what I like on Sass, and your Tutorials are always with so much value!

  • @marcorunsyay
    @marcorunsyay 2 роки тому +1

    Another fantastic video Kevin, thank you. I appreciate the extra mile, making it really scalable and future-proof. The only way to go, really.

  • @ReubenHochstetler
    @ReubenHochstetler 2 роки тому

    Love this tutorial. I don’t like logo centered menus but learning these SCSS techniques is incredible.

  • @AndyTate-1
    @AndyTate-1 2 роки тому

    Many thanks for this Kevin. Slowly getting to grips with Bricks Builder and all your associated systems. I do have to play you at 0.75 speed as you are a quick talker. Maybe it;s me that is getting older😁!!! Keep up the good work!!!!!!!!!

  • @richardc1925
    @richardc1925 Рік тому

    Kevin excellent video!! I learned a lot of useful information! Once again you blow me away with outstanding content! Thank you!

  • @chrisfoti1123
    @chrisfoti1123 2 роки тому

    Extremely Helpful, Thank you!
    Back it up, Terry. LOL!

  • @geckografix
    @geckografix 2 роки тому

    Fantastic and absolutely doable for Oxygen users

  • @nick90000
    @nick90000 Рік тому

    great tutorial, makes it easy to jump into something I've been putting off learning, SCSS in this case👍

  • @mrianforest
    @mrianforest 2 роки тому

    This is a FANTASTIC tutorial and one I've just followed. Someone mentioned below about adding a new SCSS variable for the menu items instead of using data attributes and the mixin, so I did that and all is good.
    Someone else below also mentioned that the menu will always look off-centre because the number of characters in the menu options to the left and right of the logo are not equal so the trick here is to make each the same width as the longest menu option.
    Just have to work out how to do that now! But THANK YOU for this tutorial...!

    • @mrianforest
      @mrianforest 2 роки тому

      ok figured it out, reasonably easy... replace the gap: 2em; in the UL with this...
      display: flex;
      justify-content: space-between;
      then add...
      ul li a {
      display: block;
      width: 150px; (or wider than your biggest menu option)
      padding: 5px 5px;
      text-align: center;
      }
      I've not checked to see how this degrades so I could be a right chump here, willing to take my chances...!

  • @marcsmad
    @marcsmad 2 роки тому +1

    Thank you for all the videos you make, they are very helpful. This has nothing to do with video but do you recommend motion pages? Thank you! 😁

    • @Gearyco
      @Gearyco  2 роки тому

      I’ve never used it. Animation isn’t that important to helping businesses grow. I focus on higher value design concepts.

  • @filippoponzetti
    @filippoponzetti 2 роки тому

    Absolutely brilliant! Thanks Kevin.

  • @noraholmquist8231
    @noraholmquist8231 2 роки тому

    Excellent video, both the approach and pace worked well for me.

  • @pixaful4113
    @pixaful4113 2 роки тому

    And you called me a chump! Guilty as charged! But seriously though, good lesson! learned alot! I have been using basic Sass for some time, never used a mixin until today. This will change the way I look at Sass and will certainly get more involved in it!

  • @digwillhachi
    @digwillhachi 2 роки тому

    I had this planned in my head how i would do it and i got it right (mostly) 😆So happy, i'll give myself a bonus coffee for reward !

  • @interculturalcommunication3889
    @interculturalcommunication3889 2 роки тому

    Incredibly helpful as always. Thanks Kevin.

  • @tjveach
    @tjveach 2 роки тому

    A GREAT SET OF EXAMPLES, I learned a ton! Thanks!

  • @pandaosa9
    @pandaosa9 2 роки тому

    Just followed along for the 2nd time to make my own. Pretty cool! Do you have any favorite resources to learn more SCSS? Something that I noticed on my end was that if there was a lot of variability in the character lengths of the links, it will not look centered due to the entire menu being centered with the center gap being off-center due to the sides having unequal characters. Does this happen for you too or did I make a mistake somewhere?

  • @HarigopalDasa
    @HarigopalDasa 2 роки тому

    Great tutorial . learnt a ton. Thank you

  • @Multilive1000
    @Multilive1000 2 роки тому +2

    37:40 I do not know why but the link next to the logo on the right side there is more spacing than the link on the left side of the logo. Why is that? And maybe to make it easier is to make a ACF/Metabox field in a options page called "number of links" and than pull that data into the attribute value. You can make that field a dropdown even with: 2,4,6,8 etc to make it easier. Some people do not need builder access so a field is a good option.

    • @Gearyco
      @Gearyco  2 роки тому +2

      There’s a lot of ways to do it.

    • @LastKingOfAtlantis
      @LastKingOfAtlantis 2 роки тому

      ​@@Gearyco Is there a way within the native WordPress system and/or SCSS that it could automatically count the links within the menu, rather than needing to do it manually? If there there is and is has a name I'm happy to go and research it myself, I'd just need to have a rough idea of what I would be looking for :D Thanks!

    • @Gearyco
      @Gearyco  2 роки тому

      @@LastKingOfAtlantis No, but it can probably be done with JS.

  • @ziggy6443
    @ziggy6443 2 роки тому

    Gracias Kevin! Very helpful for me, and it's fun to follow your channel . Poor Terry..;)

    • @Gearyco
      @Gearyco  2 роки тому +1

      Terry is a legend!

  • @markthomas8542
    @markthomas8542 2 роки тому

    I followed this tutorial and it worked perfectly. One strange thing, however. I have a menu with 6 links and with sub-menus and in the sub-menus, every fourth item is aligned right. What could be causing this?

    • @Gearyco
      @Gearyco  2 роки тому

      I’d have to see a link

  • @dahunsi
    @dahunsi Рік тому

    I watched this again today and I started wondering if it is possible to have the number of links be dynamically injected into the data attribute. Apologies if this had been asked and answered.

    • @Gearyco
      @Gearyco  Рік тому +1

      For sure, but there are other issues that would still need to be resolved

  • @c.s.christopher5801
    @c.s.christopher5801 2 роки тому

    Excellent tutorial!

  • @a1webguy
    @a1webguy Рік тому

    Is it possible to create a variable to take the value in [data-menu-links="x"] by calculating the value of last child, and save repeating that segment of code?

    • @Gearyco
      @Gearyco  Рік тому

      Not sure what you're asking exactly, but it doesn't sound like it. Not without JS.

  • @abdulwaheedorg
    @abdulwaheedorg Рік тому

    It's good but it's still not fully maintainable.
    How do you suppose to remember to add data attributes after 3 months?

    • @Gearyco
      @Gearyco  Рік тому

      Started recommending a JavaScript solution.

  • @DesignwithCracka
    @DesignwithCracka 2 роки тому +3

    Great video Kevin! You definitely solved one of two challenges ( i.e. the dynamic logo width/margin values) present in one of my videos that addresses the same topic. The second challenge I've experienced in using absolute positioning is how to handle menu items on one side of the split having more characters, since the logo is taken out of the document flow, the text tends to overlap it. It appears there's no way to tackle this with (S)CSS. I'm looking into a solution with JS, it seems that may be a viable solution to that issue.

    • @Gearyco
      @Gearyco  2 роки тому +4

      These centered logo menus have a lot of tradeoffs. They’re a real pain in the ass.

    • @DesignwithCracka
      @DesignwithCracka 2 роки тому +1

      @@Gearyco Yeah, nonetheless it was also a great opportunity to learn the magic of SCSS!

    • @mrianforest
      @mrianforest 2 роки тому

      I got something close to this with CSS and posted it above however on reflection it's still not 100% correct because the logo is the reference point right? So the menu options to the immediate left and right of the logo need to have the same number of characters in them in order for it to "look" centered. It's not always possible and i'm not sure how to take this forward other than for sites that MUST have a centered logo, to stick the menu options in a hamburger menu. The logo is in the middle, it re-inforces the brand, all good!

  • @DimitryChamy
    @DimitryChamy 2 роки тому

    Ok, I have a follow-up question I think has not been asked. I know this goes beyond sass but how would use the wp-menu itself to generate the data-attribute value instead of doing it manually?

  • @zac8670
    @zac8670 2 роки тому

    Amazing tutorial. Next step would be to use PHP to dynamically set the data attribute based on the number of links. Quite a fantastic tutorial!

    • @Gearyco
      @Gearyco  2 роки тому +1

      Php is above my pay grade for now.

  • @superoverdrive8628
    @superoverdrive8628 2 роки тому

    Great video Kevin! Regarding Bricks, if we are talking facts here, are the code output resulting in a noticable faster site than Oxygen would deliver? Given that they have removal of id's and classes not in use along with overall clean html etc..

    • @Gearyco
      @Gearyco  2 роки тому +1

      About the same.

  • @NicolasHeinen
    @NicolasHeinen 2 роки тому

    Hi Kevin, I don't see any header Frames template with centered logo menu, I guess it's still a work in progress ?

    • @Gearyco
      @Gearyco  2 роки тому +1

      Just hasn’t been released yet

  • @9999chippy
    @9999chippy 2 роки тому

    Great video, learnt a lot, more like this please.

  • @foofourtyone
    @foofourtyone Рік тому

    And with just one line of jQuery (or couple of lines more in vanilla JS) you could make it fully dynamic without having the need to change the data attribute by hand. Nice video

  • @Nima-Norouzi
    @Nima-Norouzi 2 роки тому

    Thanks again for this amazing tutorials 🙏
    I know this would be a silly question, but is there a way to dynamically count the number of the menu links somehow? Instead of manually writing the number in the attribute part?

    • @Gearyco
      @Gearyco  2 роки тому +2

      Not that I know of. Anything is possible, I'm sure, but that doesn't mean it's practical and implementable my most people.

  • @DejvDesign
    @DejvDesign 2 роки тому

    Hello, why did you start using bricks instead of oxygen builder? Is there some advantages?

    • @Gearyco
      @Gearyco  2 роки тому

      Oxygen is dead.

    • @DejvDesign
      @DejvDesign 2 роки тому

      @@Gearyco Why do you think that?

    • @Gearyco
      @Gearyco  2 роки тому

      @@DejvDesign a few different reasons.

  • @ranmaron
    @ranmaron 2 роки тому

    Amazing course thank you.
    More please

  • @mk-design
    @mk-design 2 роки тому

    Hey Kevin :)
    A similar template doesn't exist in Frames - or have I been missing something?
    Right now there's 4 Header templates, but the one most similar has the Logo sitting on top of the menu bar.
    I'd be very happy to have exactly THAT template you explain here in the Frames templates :)

    • @Gearyco
      @Gearyco  2 роки тому

      We removed it because it is quite technical and requires the user to understand a lot about how it works. Therefore, it is somewhat breakable. We are trying to come up with a more beginner friendly implementation.

    • @mk-design
      @mk-design 2 роки тому

      @@Gearyco Maybe it would help to offer a "Expert mode" so we could have extensive templates, too... The basic templates are somehow .... very basic

    • @Gearyco
      @Gearyco  2 роки тому

      @@mk-design because the basics cover 95% of needs when building sites. It’s your job to spice them up when you design them. And they’re not as basic as they seem when you look under the hood.
      But if you have any examples you want us to build we are more than happy to if they make sense. Just submit them to us in the group.

  • @jiripaulas9347
    @jiripaulas9347 2 роки тому +2

    Great tut! You can also reduce the code by doing a SASS loop:
    @for $i from 1 through 5 {
    [data-menu-links="#{$i*2}"] {
    @include menu-gap($i*2);
    }
    }
    And if you want flexibility for the client so he can only update the menu items in the admin and the other works automatically, you could use php or javascript function to change data attribute. But of course it's out of the scope of this video…

  • @JoshandJanicaJensen
    @JoshandJanicaJensen 2 місяці тому

    I am doing this for the first time 2 years later, but does anyone know why I can’t use the var(-logo-width) on my image on the Bricks end? It doesn’t actually do anything so I cannot control its sizing from the sass.

    • @Gearyco
      @Gearyco  Місяць тому

      This is a great question for the inner circle. A bunch of people over there can jump in and help you if you post a link. Geary.co/inner-circle

  • @trevlb
    @trevlb 2 роки тому

    Really enjoyed the deeper dive with SCSS. I wonder if a php function could be written that would write a SCSS variable based on the number of menu items, and get triggered any time the save menu button is pressed?

    • @Gearyco
      @Gearyco  2 роки тому +3

      Maybe. I’m not a php developer tho.

    • @Tom-Homer
      @Tom-Homer 2 роки тому +1

      @@Gearyco Not sure if the trade off would be worth it as it is more to maintain and their still is limitations like having an even number of menu items.
      Saying that... I wonder if a shortcode would work if you added it as the value for the data attribute in bricks...
      You can create a short code snippet in WPCodebox and add some code like: (which I assume works as I found it by Googling and have not tested it)
      // Get menu object
      $my_menu = wp_get_nav_menu_object( 'your-menu-name-or-slug' );
      // Echo count of items in menu
      echo $my_menu->count;

  • @PenaTechnologies
    @PenaTechnologies 2 роки тому

    Kevin, thanks so much for this tutorial!
    Was very interested in the a11y stuff you had. In addition to SCSS stuff, it would be badass if you could do some accessibility training as well. Lord knows many sites completely ignore that aspect.

    • @Gearyco
      @Gearyco  2 роки тому +1

      I sprinkle it into trainings here and there. In the inner circle as well we have a whole discussion section and more in depth trainings.

    • @PenaTechnologies
      @PenaTechnologies 2 роки тому

      @@Gearyco Much love, brother. Will definitely have to join your Inner Circle!

    • @Gearyco
      @Gearyco  2 роки тому +1

      @@PenaTechnologies We'd love to have you!

  • @ocbroadband
    @ocbroadband 2 роки тому

    This is F'n gold.😁

  • @tdutkowski
    @tdutkowski 2 роки тому

    I think if you don't change menu often. Center menus are often build once. Simple solution is to add left and right menus and mobile menu to wordpress and position them.

  • @haroonqraja
    @haroonqraja Рік тому

    Since the logo is usually a link to the home page, why not just add it to the nav in the middle as an img tag, give it the alt text of 'Home' and a class, and then style it using that class?

    • @Gearyco
      @Gearyco  Рік тому +1

      Then it’ll disappear when you hide the desktop menu. And it still doesn’t solve any of the issues with a centered logo.

  • @uioverhaul
    @uioverhaul 2 роки тому +1

    What if the number of menu items will be consisting of odd number, for example 7?

    • @Nima-Norouzi
      @Nima-Norouzi 2 роки тому +1

      In this case you can modify the calc count of the codes, but the issue is that the menu on the left and right side are not equal width and don't look good in terms of the design.

    • @Syphronix
      @Syphronix 2 роки тому

      Add a CTA button to the design so you now have an even number of elements (x | 'logo' | x+1)

    • @Gearyco
      @Gearyco  2 роки тому +2

      It won't look great. But if you really want to do it you just follow the same process and add the appropriate child targeting. if you don't want limitations on the number of links in your nav, don't use a centered logo menu. It's a drawback of the concept in general.

  • @stripedgoat
    @stripedgoat 2 роки тому

    Fantastic tutorial! I’m not good with math-based thinking (my brain started to heat up at the mixin part 🤣), but this was still relatively easy to follow even for me. One question I always had but never asked you thus far: I see you don’t shy away from using position: absolute whenever needed. Is that still considered a good practice? Is using position:absolute something to avoid whenever possible - in general terms? I was just working on a nested slider, and since I wanted to utilize srcset, instead of using background-image, I went with placing in an actual image, positioned aboslutely, and on top of that another div all over it (for overlay) z-indexed above, AND on top of that, the container with text. Is that a good way to do it? 😃 Thanks! 👊🏼

    • @Gearyco
      @Gearyco  2 роки тому +2

      Yeah nothing wrong with absolute positioning. It’s a valuable technique.

    • @stripedgoat
      @stripedgoat 2 роки тому

      @@Gearyco That's great to hear! Thanks for your reply! ✌🏼

  • @techfairyrina
    @techfairyrina 2 роки тому

    Just GOLD!

  • @michaelvandinther
    @michaelvandinther 2 роки тому

    Nice! Make the data attribute dynamic 🙂

  • @AmandaLucaseu
    @AmandaLucaseu 2 роки тому

    This was awesome!! Thank you for walking us through it. With wp Codebox, do you save this as a cloud snippet so you can easily pull this in when building a site with centred logo.

    • @Gearyco
      @Gearyco  2 роки тому +2

      You definitely could! Or … just use frames since it’s going to be in the next round of frames updates.

    • @Tom-Homer
      @Tom-Homer 2 роки тому

      @@Gearyco I guess Frames will need a description for some templates to explain the limitations (ie even # of menu items) and basics of what the data attribute is for

    • @AmandaLucaseu
      @AmandaLucaseu 2 роки тому

      @@Gearyco doh 🫣 of course

    • @Gearyco
      @Gearyco  2 роки тому +1

      @@Tom-Homer yes planning on adding documentation for certain frames.

  •  6 місяців тому

    I read the description where you wrote it is included in Frames ─ But it is not.

    • @Gearyco
      @Gearyco  6 місяців тому

      We removed because it’s too difficult for most users to manage properly

  • @HEYVIET
    @HEYVIET 2 роки тому

    Why not just add the logo as a menu item and add a class to it that way? Seems like it’d be a quicker method to center your logo in the menu items. No SCSS or other complexities needed?

    • @Gearyco
      @Gearyco  2 роки тому

      There are many ways to accomplish the same thing. each with different pros and cons. technically, the logo is not part of the NAV. and when you put it in the wordpress menu, you are making it part of the navigation. So there is a potential argument about semantic accuracy and accessibility there.

  • @serhiididenko
    @serhiididenko Рік тому

    🔥🔥🔥🔥🔥🔥

  • @kappesante
    @kappesante 2 роки тому

    we all love you. you know that, ye?

    • @Gearyco
      @Gearyco  2 роки тому

      🙏

    • @kappesante
      @kappesante 2 роки тому

      @@Gearyco i mean, the amount of value here is damn high. and funny as hell. dunno how many people can find coding fun, i hated it for 20 years enjoying the only graphical aspect of my job, and now it’s funny. great teacher.

    • @brunopapas
      @brunopapas Рік тому

      @@kappesante same here 🤯....getting so much fun learning things!!!

  • @andrew.schaeffer4032
    @andrew.schaeffer4032 2 роки тому

    That's slick man. I'm betting you know how to loop those links so you don't need to manually enter the number when you add more links ;)

    • @Gearyco
      @Gearyco  2 роки тому +1

      Do you know something I don’t?

    • @andrew.schaeffer4032
      @andrew.schaeffer4032 2 роки тому

      @@Gearyco maybe it's only possible in js then? Coulda sworn scss could do something like that

    • @Tom-Homer
      @Tom-Homer 2 роки тому +1

      @@andrew.schaeffer4032 No SCSS like CSS doesn't have access to the html so the only way would be JS unless you inline the css or update the data attribute using php when the page is requested

  • @phase4485
    @phase4485 16 днів тому

    Such a long winded and complicated way just to make a centred menu. In Webflow I could have created the same thing easily in just a couple of minutes. But good video for Bricks users 😊

  • @MyKelvin01
    @MyKelvin01 2 роки тому

    There's an easier & simpler ways to have a centered logo. You just have to create 2 menus; one for left and one for right. Less headache. I mean, It works just perfectly. Amazing technique still.

    • @Gearyco
      @Gearyco  2 роки тому +1

      Hard to maintain (moving a menu item from left to right). Hard to degrade to mobile (you need a third menu?). It’s definitely an option but has many downsides. These types of menus are a pain in the ass in general.

    • @MyKelvin01
      @MyKelvin01 2 роки тому

      @@Gearyco yes, you need a third menu for mobile. Set the desktop Manu to hidden and BAM! I mean, it's not as dynamic as using the scss. It's just a cheap trick that works for "designers". however, a developer might lean more to the scss approach.

  • @TheCredibleHulk
    @TheCredibleHulk 2 роки тому

    I think the mixin and data attribute were both an overkill, and, in the end, result in a lot of completely redundant CSS being generated.
    You already saved logo width as a SCSS variable (meaning you’d have to edit the SCSS to modify it), then why not also create a variable for menu items count, e.g “$links-count: 4;”? Then simply extrapolate the SCSS “:nth-child(#{$links-count / 2 + 1})” and “:nth-child(#{$links-count / 2})” and you are done. If you ever change the number of menu items, simply edit that SCSS variable and you are done.
    As a result - you have CSS that contains EXACTLY what you need. Nothing less, nothing more. Instead of what it is right now - bunch of unused, mostly duplicated CSS lines just to potentially cover other scenarios. AND you also have to deal with some additional data attribute in Bricks, which doesn’t pass the “3m rule” in my books.

    • @Gearyco
      @Gearyco  2 роки тому

      Thanks for your thoughts

  • @anthonyramos5338
    @anthonyramos5338 2 роки тому

    i self taught myself photoshop cs6... i wish i knew about tNice tutorials when i was in the self teacNice tutorialng mood

  • @nikitapatil7997
    @nikitapatil7997 2 роки тому

    dude just look it up, there are free providers out there, it s goddaym expensive to buy, especially when you re a pro soft maker.

  • @DimitryChamy
    @DimitryChamy 2 роки тому

    Cunning, conniving, and sly, as usual.