Not sure if this is a bug or maybe I have configed something wrong>

I have a tabbed view with at least ten tabs. They are an archive for past meetings. I was getting normal tabs until the tabs ran on to a second line. This triggered the responsive menu in the desktop view of the site.

You can see it in action here

http://cc.rosenet.tv/past-meetings-events

I have checked it in FF, Chrome, and Opera, all on LInux. Same thing.

Is this a bug, or intended behavior? Or can I configure something a different way to avoid this behavior?

Comments

RKopacz created an issue. See original summary.

RKopacz’s picture

Issue summary: View changes
Jeff Burnz’s picture

Category: Bug report » Support request
Priority: Major » Normal

It's intended behaviour - what did you want to happen instead? I can show you how to change it.

RKopacz’s picture

Hi Jeff, well, on a desktop, I'd like it to just wrap to a second line. The other plan was to make the fonts and the spacing in the tabs smaller so that they all appear on one line, but that would be only temporary, as the years will accumulate over time and I will end up with a wrap to the second line.

I would actually prefer to do a summary list or a glossary style in a block with a date limited to the year using a contextual filter, but that doesn't seem to be available in 8 right now, with the limited Date module integration into core.

Jeff Burnz’s picture

Should have asked before, are you using SCSS/SASS?

RKopacz’s picture

Yes, SASS.

RKopacz’s picture

Just checking in on this question. If you could show me how to do this, I would be appreciative.

Happy Holidays!

Jeff Burnz’s picture

I'll write a docs page for it, shortly, I am on holiday but also these past days I've had the flu, groan... not fun :/

Jeff Burnz’s picture

In short...

~/styles/uikit/components/partials/component/_tabs.scss

In that file there are two important classes - .is-vertical and .is-horizontal, which set the "narrow" and "wide" styles respectively. These selectors are set with Javascript.

The "styles" are mixins, which are passed a selector - you can locate many types of "list styles" in the mixins directory: ~/styles/uikit/components/mixins

This is the default:

  // Set the narrow style.
  .is-vertical {
    @include list-style-button-group-vertical('ul.tabs--primary');
    @include list-style-seven-vertical('ul.tabs--secondary');
  }

  // Set the wide style.
  .is-horizontal {
    @include list-style-tab-group('ul.tabs--primary');
    @include list-style-seven-horizontal('ul.tabs--secondary');
  }

Additionally you can set fallback (no-js) styles if JS is not being used etc:

  // Use media queries when JS is unavailable.
  @media #{$mobile} {
    .no-js & {
      @include list-style-button-group-vertical('ul.tabs--primary');
      @include list-style-seven-vertical('ul.tabs--secondary');
    }
  }

  @media #{$tablet-landscape} {
    .no-js & {
      @include list-style-tab-group('ul.tabs--primary');
      @include list-style-seven-horizontal('ul.tabs--secondary');
    }
  }

What you could do is something like this, since you want them to wrap, buttons might be an appropriate style for both vertical and horizontal states:

  .is-vertical,
  .is-horizontal {
    @include list-style-buttons('ul.tabs--primary');
    @include list-style-seven-horizontal('ul.tabs--secondary');
  }

If you're using a later version of the theme these layouts will use Flexbox (earlier RC2 will use floats), if they're using flexbox you'll need to add a line of code to .tabs (in the same file):

.tabs {
  flex-wrap: wrap;
}

Of course by all means hack the mixins to give yourself unique styles, the theme is meant to be hacked, nothing is sacred :)

RKopacz’s picture

Jeff, Thanks so very much for this. So sorry to hear about the Flu! Been there, done that, greatly appreciate your taking the time, particularly under the circumstances.

Happy holiday season and Happy New Year!

RKopacz’s picture

Jeff, Just for general reference, I am putting in here what I did, so if others have a similar preference they can apply it.

in the _tabs.scss file, I put the following code inside the .is_vertical class:

    .path-past-meetings-events & {
        @include list-style-tab-group('ul.tabs--primary');
        @include list-style-seven-horizontal('ul.tabs--secondary');
    }

Essentially just applying the horizontal styles in that instance of the .is_vertical class.

Perhaps not the most programmatically elegant solution, but it worked :-)

Thanks again for your help and Happy New Year!

Jeff Burnz’s picture

Looks good to me if you only want the style on a particular page - great!

Jeff Burnz’s picture

Version: 8.x-1.0-rc2 » 8.x-2.x-dev
Component: Mobile » Documentation
Category: Support request » Task

Needs converting into docs.

Maybe here somewhere: https://docs.adaptivethemes.com/theming/uikit/