Brand Header

Thanks @vinothkannans. Just to clarify to everyone like me, you need to do two things, I was trying to do all in one place in custom fonts icon with URL and it was not working.

  1. Add fab-youtube in the custom font awesome icons theme setting
  2. Now add the url 'youtube, ’ in the icons section for the URL.
3 Likes

Hi there, an awesome component which makes a corporate forum so much better.
One question, can this be hidden completely on mobile browsers from css? The double burger menus seems confusing for some users.

Thank you.

1 Like

Yes, you can hide it via below CSS

.mobile-view {
  .b-header {
    display:none;
  }
  .ember-application .d-header {
    margin-top: 0;
  }
}
7 Likes

Thank you so much. Easy and fast solution.

1 Like

Thanks for this its a great addition to the discourse forums. I have as mentioned above applied settings for youtube and twitter, but > fab-linkedin not available or it doesn’t seem to appear.
Although there is a space on the header that you can click and view linkedin. So at the moment there is a blank space where there should/could be a linkedin icon.

How do i get the extra > custom font awesome icons
fontawesomeiconmissing

Many thanks,

1 Like

It’s different for linkedin.

https://github.com/discourse/discourse/blob/0d3531c2f1f1ea2f7625d691bd0e3219763e388b/app/assets/javascripts/discourse-common/lib/icon-library.js.es6#L291-L292

6 Likes

Thankyou Vinoth, fantastic!

3 Likes

The component is not compatible with rtl websites. What should we do?

I tried it before. But it demanded more changes than I expected. It’s not in my current roadmap. #pr-welcome.

3 Likes

I can submit a PR however I just don’t know how can I get the direction of discourse as a variable in theme component.

1 Like

In RTL layout <html> tag will include the CSS class rtl. You can do the customization based on it. If needed you can also check it in JS code by calling const isRTL = $("html").hasClass("rtl");.

1 Like

Sorry I didn’t understand you correctly. I just need to add a variable in common.scss file that indicates discourse global direction. I didn’t find such variable here:

If I have that variable in common.scss the customization would be pretty straightforward. Otherwise I don’t know how to do it.

Yes, we don’t have a global CSS variable I guess. You should check rtl.scss file to understand howto customize.

I submitted a pr

https://github.com/discourse/discourse-brand-header/pull/3

3 Likes

In the mobile view, when we click on the hamburger menu, if then we click outside of the menu, the hamburger menu would be expanded even more, instead of closing. and also it has some other glitches. for example when hamburger menu is open and we click on a topic link.

1 Like

It’s merged. Thanks for the PR :heart:.

5 Likes

Does anyone know how to keep this new header from making the main header jerky when scrolling down? It will make the main discourse header dissapear then reappear quickly once when scrolling down for the first time after page load.

Anyone know what Im talking about?

3 Likes

Same issue as discussed (and fixed) here?

I’m only using the main logo and link in this theme component, but the hamburger menu still shows up on mobile, even though clicking it just shows an empty box.

Any way to hide the menu if it’s empty?

Thanks!

You can hide it by adding the below CSS in mobile theme.

.b-header .panel {
    display: none;
}
2 Likes