Mobile nav button theming messed up. Help, likely not a bug.

Created on 23 March 2024, 9 months ago
Updated 16 April 2024, 8 months ago

Problem/Motivation

I just created my first multi-level TB MM on a project and it looks great on the desktop browser.

I put some nav classes on the container for dark theme and primary color and it looks nice.
navbar navbar-dark bg-primary bg-edge2edge justify-content-center

I did some scss theming in my theme to do some hover reverse color highlighting and making my secondary menu have a different color theme.

/var/www/varbase/docroot/themes/custom/lab_theme/components/organisms/navbar$ cat navbar.scss
$sj_maroon: #ad3d3d;
$sj_gold: #CCA966;
$primary:       $sj_maroon;

$a-tags: 'a, a:active, a:hover, a:visited';
$a-tags-hover: 'a:active, a:hover';

#block-lab-theme-secondarymenu-2 {
--bs-navbar-padding-y: 0;
}

#block-lab-theme-secondarymenu-2 {
//#block-st-jude-theme-secondarymenu {
  #{$a-tags} {
    color: $sj_gold;
    text-decoration: none;
  }
  #{$a-tags-hover} {
    background-color: $sj_gold;
    color: $sj_maroon;
  }
}

//.tbm-link .level-2 .no-link .tbm-group-title {
.tbm-subnav>.tbm-item>.tbm-link-container>.tbm-link {
        color: $sj_maroon !important;
}

.tbm-submenu {
  background-color: $sj_gold !important;

  #{$a-tags} {
    color: $sj_maroon !important;
    text-decoration: none;
  }
  #{$a-tags-hover} {
    background-color: #c39e57 !important;
//    color: $sj_gold;
  }
}

But on mobile, I am getting the link buttons with only a very narrow portion colored.

Has anyone ever run in to this and can help me figure out my mistake?

Thanks

๐Ÿ’ฌ Support request
Status

Active

Version

3.0

Component

Documentation

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States HeneryH

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @HeneryH
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States HeneryH

    It is the "justify-content-center" class on the menu block on the block layout page that is messing things up.

    But if I don't have that, then the fact that I put the edge-to-edge screws up my alignment.

    The goal of having edge-to-edge AND centered is proving a challenge.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia ravi kant Jaipur

    ravi kant โ†’ made their first commit to this issueโ€™s fork.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia ravi kant Jaipur

    The issue is due to custom theme.
    I did not find issue in default styles.
    So the issue will be fix according custom work of custom theme.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States HeneryH

    In your example, the menu is left justified. I noted in my OP that the issue happens when the menu is centered.

    If you have testing ability on your site, can you apply the

    justify-content-center
    

    class to the menu block in the block layout configuration page?

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia ravi kant Jaipur

    TB Mega menu also have option to add classes on parent and child item's wrapper.


  • ๐Ÿ‡บ๐Ÿ‡ธUnited States HeneryH

    So does it look ok on mobile when you do that or not?

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia ravi kant Jaipur

    @HeneryH
    I just review again your comments.
    I think something is broking due to your custom styles work.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States HeneryH

    Can you just confirm that your test shown above results in the proper behavior? You showed centering the menu with a class but you won't confirm that it looks proper on mobile.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia ravi kant Jaipur

    @HeneryH
    I have added a mobile view screenshot in #5
    So i can say that it working as designed in mobile devices.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States HeneryH

    Ravi, that screen shot is left justified. This post is about center justified.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia ravi kant Jaipur

    @HeneryH
    I have just confirmed with justifying option. I am not getting any issues.
    So I am sure that you are getting the issue due to other styles.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States HeneryH

    I don't understand the misunderstanding here. The image that you are providing for evidence is NOT center justified.
    It is clearly left justified.

    Am I mistaken? Comparing my image above that is center justified to your image that is left justified.

    You are showing a left-justified image to say that my scenario of center justified usage is a flawed issue.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia ravi kant Jaipur

    I am checking in olivero theme.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia ravi kant Jaipur

    @HeneryH
    Is possible to share your website URL? so i can check actual possible issue.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States HeneryH

    Sure, here it is. Looks fine on desktop, Mobile is messed up.

    https://www.flynnconsultingllc.com/

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia ravi kant Jaipur

    @HeneryH
    The issue is due to display flex properly on block-content dev.
    This can fix by overwriting styles.
    Please see the attached video "issue-is-due-to-default-style.mov"

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States HeneryH

    Thank you for your time helping me debug this. I knew it was unlikely a bug and appreciate your help. I will investigate with your suggestion.

Production build 0.71.5 2024