- This topic has 15 replies, 4 voices, and was last updated 3 years ago by Elvin.
-
AuthorPosts
-
January 6, 2020 at 6:24 pm #1124120Fleur
How do I change the font-size of the sub navigation (drop down from main nav) ?
January 6, 2020 at 7:16 pm #1124140LeoStaffCustomer SupportHi there,
Try this CSS:
.main-navigation .main-nav ul ul li a { font-size: 15px; }
Adding CSS: https://docs.generatepress.com/article/adding-css/
Let me know if this helps π
January 6, 2020 at 7:28 pm #1124143FleurHi, thanks for your reply, but why is this option not available in the main Customizer – I can change the main nav font size, but not the sub nav…
January 6, 2020 at 7:32 pm #1124147LeoStaffCustomer SupportI’d say that it’s not very commonly requested which is why we are always happy to help with some quick CSS π
If it comes up more often we will definitely consider adding it as an option.
Thanks for your input!
January 6, 2020 at 8:24 pm #1124170FleurNo worries and thanks!
January 6, 2020 at 8:27 pm #1124178LeoStaffCustomer SupportNo problem π
February 28, 2021 at 8:23 am #1676206LenJust spent ages finding this answer, thinking I had missed something so fundamental in the customiser. It would have taken far less time had I known I needed to use CSS.
Can you please consider this for the customiser, or at least as a default force the dropdown font size the same as the menu font size so the one setting does both.
Thanks.February 28, 2021 at 11:10 am #1676358LeoStaffCustomer SupportHi Len,
I really feel like it doesn’t come up that often but will definitely consider it.
Thanks for your input!
April 12, 2021 at 9:39 pm #1731970Brent WilsonThis css seems to change the font size of sub-navigation on desktop, but not on tablet/mobile. What do I need to add to the code to get it to change those as well?
April 12, 2021 at 9:44 pm #1731973ElvinStaffCustomer SupportHi Brent,
did you mean the CSS on this reply?
https://generatepress.com/forums/topic/change-size-font-on-sub-navigation/#post-1124140If so, that should apply to all viewports since there’s no
@media(){}
rule to make it exclusive to any viewport.Can you link us to the site you’re applying this on to check?
If you wish to keep it private? Can you open a new topic for this? So you can use the private information text field. π
April 12, 2021 at 9:50 pm #1731974Brent Wilsonhttps://wordpress-519773-1848753.cloudwaysapps.com/. I have added this css (so the dropdown font size should be the same as the main menu items):
.main-navigation .main-nav ul ul li a { font-size: 17px; }
April 12, 2021 at 10:02 pm #1731978ElvinStaffCustomer SupportAh I see what you mean.
That CSS loses on precedence against this CSS from the generated CSS by the customizer.
@media (max-width: 908px) .main-navigation:not(.slideout-navigation) .main-nav ul ul li a { font-size: 14px; }
To address that, add this CSS
@media (max-width: 908px){ .main-navigation:not(.slideout-navigation) .main-nav ul ul li a { font-size: 17px; } }
April 12, 2021 at 10:10 pm #1731980Brent WilsonThanks! That seemed to fix the issue. Did I do something wrong in the customizer that created the higher precedence css? Or would this be considered normal for it to be generating this code:
@media (max-width: 908px) .main-navigation:not(.slideout-navigation) .main-nav ul ul li a { font-size: 14px; }
April 12, 2021 at 10:23 pm #1731989ElvinStaffCustomer SupportThanks! That seemed to fix the issue. Did I do something wrong in the customizer that created the higher precedence css? Or would this be considered normal for it to be generating this code:
No it’s fine. It’s normal. The 14px is something inherited from what is set from the Primary Navigation’s font size on mobile found in Appearance > Customize > Typography > Primary Navigation. The font size value is what you’ve set minus 1.
Example, if you’ve set 14px, the font size will be 13px on the generated stylesheet. Not exactly sure why Tom did this though. Will ask him when I get the chance.
April 12, 2021 at 10:25 pm #1731991Brent WilsonIn this case, maybe it was -3? Set 17px, and the generated stylesheet had 14px.
-
AuthorPosts
- You must be logged in to reply to this topic.