question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Question/Enhancement] How to Export CSS linked in Canvas Styles properties

See original GitHub issue

How to export the HTML/CSS in the code view / download as zip. With the stylesheets in styles.css referenced in the grapesjs canvas, but not the unused, actually i am fine with all the styles.css stylesheet, for simple API access for export.

If I add the stylesheet in init

      canvas: {
      styles: ['./styles.css'] 
      }
    bm.add('Table', {
      label: 'Table',
      category: 'Table',
      content: {
        type: 'table',
        classes: ['table-components'],
        columns: 2,
        rows: 1, 
        //style: {width: '100%', border: '1px solid black'}
      },
    });

Yea, Table 😋 Thanks for the good work, let us worry about this easy issue and documenting or leave trace in issue list. Artf should focus more on other amazing features.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
artfcommented, Jul 14, 2019

The issue I have is that when I try to export the code using the grapesjs export plugin nothing referenced inside canvas is exported.

@Yakito For now, those scripts/styles should be included manually, you can use root option from the export plugin:

root: {
  ...
  'index.html': ed => `
	<head>
		<link href="${myStyle}" .../>
		<script src="${myScript}" .../>
	</head>
	<body>${ed.getHtml()}</body>
  `
}
1reaction
artfcommented, Jan 25, 2018

@chiqui3d definitely it shouldn’t be added to what is used for storing otherwise you will add those styles twice.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Extract CSS | Illustrator CC - Adobe Support
Select a specific code and select Copy Selected Style to copy it to the clipboard. Select the CSS Properties Panel menu and select...
Read more >
Adding CSS & JS and Overriding the Page-Load Template
Learn how to add custom CSS and JS to your app as well as how to customize the HTML title, meta tags, and...
Read more >
How do I upload custom JavaScript and CSS files to...
To upload files for the Canvas desktop application, locate the CSS file/JavaScript file headings [1]. To upload files for user content in Canvas...
Read more >
Using images - Canvas API - MDN Web Docs
Until now we have created our own shapes and applied styles to them. ... Importing images into a canvas is basically a two...
Read more >
CSS - Cascading Style Sheets, designing for the Web - W3C
We discuss using the style attribute in Chapter 4 , "CSS selectors," and using the link element and the @import notation in Chapter...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found