grapesjs icon indicating copy to clipboard operation
grapesjs copied to clipboard

link element not append in head element in ediot.canvas #firefox #grapesjs

Open sampathrajs opened this issue 6 years ago • 3 comments

am trying to add google fonts in web-builder to change the font style for that to import am adding cdn in editor the code works in chrome and safari but firefox not working

createLinkElement(fontFamily) { let link = document.createElement("LINK"); link.setAttribute("rel", "stylesheet"); link.setAttribute("href", https://fonts.googleapis.com/css?family=${fontFamily}); return link; }

editor.Canvas.getDocument().head.append(this.createLinkElement(fontFamily));

element also not appending

sampathrajs avatar Mar 19 '20 11:03 sampathrajs

I've made the issue template for a reason

artf avatar Mar 20 '20 00:03 artf

I've made the issue template for a reason

i want to add custom fonts in web builder could you please help me out

sampathrajs avatar Mar 20 '20 02:03 sampathrajs

Hi! might be very late to comment but have you tried this? - const link1 = document.createElement('link'); link1.rel = 'stylesheet'; link1.href = '/page-builder-assets/css/style.css'; canvas.getDocument().head.appendChild(link1);

it worked for me

RutujaBadbe avatar Feb 27 '21 11:02 RutujaBadbe