Home > Blockchain >  CSS not imported in Grapesjs Components
CSS not imported in Grapesjs Components

Time:11-26

working in grapesjs adding templates as components with add CSS but CSS not import. Also tried the public/index.html file but not working. Help!

          canvas: {
                   styles:[
         '<link rel="stylesheet" href="http://localhost:3000/assets/css/headers/style.css" type="style.css" />',
         '<link rel="stylesheet" href="http://localhost:3000/assets/css/headers/bootstrap.css" type="text/css" />',
                      ],
                },

CodePudding user response:

Just call from local driectory like : C:/documents/[your project source]/ Not go with localhost

CodePudding user response:

You only need to specify the URL of the stylesheet, not the entire link tag.

canvas: {
    styles:[
        'http://localhost:3000/assets/css/headers/style.css',       
        'http://localhost:3000/assets/css/headers/bootstrap.css'
    ]
}

CodePudding user response:

it's Working on removing link tags and only defining with localhost link.

 canvas:{
    styles:[
'http://localhost:3000/assets/css/headers/style.css',
'http://localhost:3000/assets/css/headers/dark.css',
   ]
 } 

 

  • Related