Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #2
RKopacz CreditAttribution: RKopacz commentedComment #3
Jeff Burnz CreditAttribution: Jeff Burnz commentedIt's intended behaviour - what did you want to happen instead? I can show you how to change it.
Comment #4
RKopacz CreditAttribution: RKopacz commentedHi 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.
Comment #5
Jeff Burnz CreditAttribution: Jeff Burnz commentedShould have asked before, are you using SCSS/SASS?
Comment #6
RKopacz CreditAttribution: RKopacz commentedYes, SASS.
Comment #7
RKopacz CreditAttribution: RKopacz commentedJust checking in on this question. If you could show me how to do this, I would be appreciative.
Happy Holidays!
Comment #8
Jeff Burnz CreditAttribution: Jeff Burnz commentedI'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 :/
Comment #9
Jeff Burnz CreditAttribution: Jeff Burnz commentedIn 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:
Additionally you can set fallback (no-js) styles if JS is not being used etc:
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:
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):
Of course by all means hack the mixins to give yourself unique styles, the theme is meant to be hacked, nothing is sacred :)
Comment #10
RKopacz CreditAttribution: RKopacz commentedJeff, 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!
Comment #11
RKopacz CreditAttribution: RKopacz commentedJeff, 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:
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!
Comment #12
Jeff Burnz CreditAttribution: Jeff Burnz commentedLooks good to me if you only want the style on a particular page - great!
Comment #13
Jeff Burnz CreditAttribution: Jeff Burnz commentedNeeds converting into docs.
Maybe here somewhere: https://docs.adaptivethemes.com/theming/uikit/