codimd icon indicating copy to clipboard operation
codimd copied to clipboard

Unable to import font in slide mode

Open ilanolkies opened this issue 5 years ago • 2 comments
trafficstars

Is there a way to import a font from Google APIs and use it in slides?

I tried things like this but couldn't find way out.

<style type="text/css">
    @import url('https://fonts.googleapis.com/css2?family=Rubik:wght@300&display=swap');
...

Great work, the app is excellent

ilanolkies avatar May 21 '20 00:05 ilanolkies

I had the same problem with a conference talk I gave using hackmd.io. @import seems to be ignored. @font-face seems to work in principal, but the content security policy prevents my chrome from loading the font from https://fonts.gstatic.com/. The workarounds I am aware of are using @font-face and

  • using a plugin in chrome to disable CSP or
  • in a local codimd instance, disable CSP by setting CMD_CSP_ENABLE=false

johannesflake avatar Sep 24 '20 14:09 johannesflake

Hi everyone, We explicit removed support of @import in CSS style tag to avoid security issues which you can load arbitrary files in.

jackycute avatar May 12 '21 15:05 jackycute