Archived topic
Font Bug with RC1
5 replies · Started by Adrien on October 15, 2021
Dear Team,
I have a script displaying a chat widget for customer support. Whenever the script triggers, it replaces all my base fonts to inherit the chat widget font.
I made a quick video to show you: https://www.awesomescreenshot.com/video/5647794?key=01d005cb23397ff6a2f0bc670943d735
Here's the script placed in an element hook:
<script>
!function(t,e,n){function s(){
const t=e.getElementsByTagName("script")[0],n=e.createElement("script");
n.type="text/javascript",n.async=!0,n.src="https://assistant.thrivedesk.io/bootloader.js?"+Date.now(),
t.parentNode.insertBefore(n,t)}if(t.Assistant=n=function(e,n,s){t.Assistant.readyQueue.push({method:e,options:n,data:s})},
n.readyQueue=[],"complete"===e.readyState)return s();
t.attachEvent?t.attachEvent("onload",s):t.addEventListener("load",s,!1)}
(window,document,window.Assistant||function(){}),window.Assistant("init","94a213d8-7aae-44d6-a345-b116212c1066");
</script>
Thank you for your time and help. Kind regards, adrien
Hi there,
could you provide us a log in to see the site ?
Dear David, Please find enclosed the private info as requested. Thanks for your help!
The script is loading its own inline CSS including this:
:root {
--color-primary: #3B82F6;
--color-white: #fff;
--color-black: #1F2937;
--color-gray: #6B7280;
--color-medium-gray: #D1D5DB;
--color-light-gray: #F3F4F6;
--p-1: 8px;
--p-2: 16px;
--td-font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;
--td-chat-header-height: 202px;
}
body {
font-family: var(--td-font-family);
}
Which is swapping the body font for the system font stack it has loaded in the --td-font-family root variable.
Did this issue only appear after updating to RC1 ? As i would expect it to have affected the older versions.
Does the provider of the script offer support ?
As this needs to be removed:
body {
font-family: var(--td-font-family);
}
or changed to:
.td-assistant {
font-family: var(--td-font-family);
}
Dear David, Wouawww thank you so much for the solution.
Im unable to say if this happened before RC1 because Ive installed the script after.
Your solution has been sent to the devs. I appreciate your help and time in solving this.
In case things don't work as expected and involve GP which I highly doubt, Ill contact you again.
Thanks again. Kind regards, adrien
I think it would have affected all versions of the theme, as the scripts styles are loaded after GP's and using global variables it wins over our CSS.
Let us know how you get on!