Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

284
Views
Custom font won't be used on chromebook but works fine in (mac) chrome

Got this little project where I inject a weather widget into google calendar. I wish to use a google font with the widget. My attempt with an npm package (previous commits) worked fine in chrome (on a mac), but not on the chromebook tablet that I want to use it on.

I then changed tactic to inject a link tag like this

console.log('Weather widget extension for google calendar executing')

document.addEventListener('DOMContentLoaded', function(event) {
  console.log({ event })

  const linkElement = document.createElement('link')
  linkElement.rel = 'stylesheet'
  linkElement.href = 'https://fonts.googleapis.com/css?family=Gemunu+Libre'
  document.head.appendChild(linkElement)
  console.log({ linkElement })

  const mainDiv = document.createElement('div')
  mainDiv.className = 'weather-widget__main'
  mainDiv.setAttribute(
    'style',
    `position: absolute;
  z-index: 1000;
  right: 20px;
  bottom: 20px;
  background: linear-gradient(145deg, #024acf0a, #0721d74f);
  opacity: 70%;
  padding: 10px;
  border: 1px solid #0721d74f;
  box-shadow: 0px 0px 10px #0721d74f;
  border-radius: 10px;
  font-family: Gemunu Libre, Roboto;
`
  )
  document.body.appendChild(mainDiv)
...

this also works in chrome but not on the chromebook?


Not that it is relevant but I'm writing it in typescript and using vite with a plugin to build it. If you want to use it you have make a .env file

.env

VITE_API_KEY=<your openweathermap api key>
VITE_LAT=<your lattitude>
VITE_LON=<your longitude>

run yarn build and load the dist folder as a local extension in chrome.

Solution

Setting the custom font by inline styling in each block seem to do the trick ๐Ÿ‘

(Doing font-family: inherit; did not work)

about 4 years ago ยท Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
ยฉ 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!