Font responsiveness issue within the title of accordion entries

Dear supporters,


while building a website on BeTheme I ran into a font responsiveness issue within the title of accordion entries. To adjust the size and style of the font (and colors while active / inactive) I have used some custom CSS (partially based on what I have learned from earlier discussions in this forum):


.accordion_wrapper .question .title{

  font-size: 18px !important;

  font-optical-sizing: inherit !important;

  font-weight: 400 !important;

  color: #951b81 !important;

}


.accordion_wrapper .active .title{

   font-size: 18px !important;

   font-optical-sizing: inherit !important;

   font-weight: 400 !important;

  color: #ec6608 !important;

}


Please note that 18 px is the font size, I use for regular content (<p>CONTENT</p>).


The font sizes which one defines in BeTheme's options (<p>,<h1>...<h6>) do behave responsively, i.e. they scale down on mobile phones. Unfortunately, the font size of the titles of accordion entries titles does not. To illustrate the issue, I add screenshots from a desktop client (Google Chrome on Kubuntu 18.04) and a mobile client (Google Chrome on Android 10, namely a Nokia 7.2 phone).

Here comes the desktop screenshot:

And here the mobile phone screenshot:

As you can see, the content within and outside the accordion scales properly on the mobile phone, so does <h1>Leistungen</h1>. However, the accordion's entry titles do not scale (e.g. "Behandlungskonzept", "Prophylaxe", ...) making them look somewhat overgrown in that context.


The non-responsiveness of the accordion's entry titles is not a result of the custom CSS, it stays the same when the custom CSS is put in comments (/* ... */), just with BeTheme's default colors, font sizes and styles.


For BeTheme obviously brings mechanisms to be responsive in terms of font size I would like to know, if there is a way to put them in effect for the font size of the accordion's entry titles.


Sorry for the very exhaustive post. I just like to make the problem very clear.


If there are any questions, I will most happily respond.


Thank you very much in advance.


Best regards,

Christian

Comments

  • Hello,

    In that case you can use Custom CSS with media queries.

    Your CSS Code should look like this:

    @media only screen and (max-width:767px){
       .accordion_wrapper .question .title{
     font-size: 14px !important;
     font-optical-sizing: inherit !important;
     font-weight: 400 !important;
     color: #951b81 !important;
    }
    .accordion_wrapper .active .title{
      font-size: 14px !important;
      font-optical-sizing: inherit !important;
      font-weight: 400 !important;
     color: #ec6608 !important;
    }
    }
    

    As you can see with this media queries this Custom CSS will affect only screens below 767px. In brackets you can use any values you want or you can combine max-width with min-width like this: (max-width:767px) and (min-width:400px).


    Thanks

  • Dear Phil,

    thank you so much for your quick and helpful response.

    Albeit I need to refine the settings (the theme does not seem to scale the fonts in some sort of binary logic [desktop vs. mobile] but in multiple steps - I can figure out the limits using the DevTools within Google Chrome), the general approach just works beautifully.

    Regards,

    Christian

Sign In or Register to comment.
This website uses cookies

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.

Cookies are small text files that can be used by websites to make a user's experience more efficient.

The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies we need your permission. This means that cookies which are categorized as necessary, are processed based on GDPR Art. 6 (1) (f). All other cookies, meaning those from the categories preferences and marketing, are processed based on GDPR Art. 6 (1) (a) GDPR.

This site uses different types of cookies. Some cookies are placed by third party services that appear on our pages.

You can at any time change or withdraw your consent from the Cookie Declaration on our website.

Learn more about who we are, how you can contact us and how we process personal data in our Privacy Policy.

Please state your consent ID and date when you contact us regarding your consent.