Custom CSS not working (but previously worked well)

  • Issue description:

Custom CSS not working and not applied to the weather widget. The custom css previously worked well but since 3 weeks ago it got problem and the css not applied. I never change the custom CSS. My concern is the width stuck at 300px and Nunito font is not applied.

My CSS:

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;700&display=swap');

.eapp-weather-weather-component {
    max-width: 500px !important;
    width: 100%;
}

.eapp-weather-forecast-component {
  margin-top: 46px;
}

.eapp-weather-detail-component {
  padding: 26px 24px 0;
}

.eapp-weather-weather-detail {
  font: 400 14px / 18px "Nunito", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol" !important;
  padding-bottom: 15px;
  height: 232px;
}

2 Likes

Hi there, @retiarylime :wave:

We’ve fixed the issue with the width by adding .global-styles, at the beginning:

As for the font, it seems to be working correctly now. Could you please double-check it?

1 Like

The width is working now. However the font still not changing to Nunito when viewing on android. It seems to fall back to system font.

2 Likes

Got it, thanks!

I’ll double-check it with the devs and update you later :slightly_smiling_face:

Seems like elfsight custom css unable to load imported fonts.

1 Like

Hi @retiarylime :wave:

We’ve added this code to the Custom JS field on the Style tab of your widget’s settings:

(function() {
  const style = document.createElement('style');
  style.textContent = "@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;700&display=swap');";
  document.head.append(style);
})();

Please check your widget and let me know if the correct font is applied now :slightly_smiling_face:

2 Likes

It’s working now. Tq.

1 Like

Great, you’re always welcome :wink: