-
Notifications
You must be signed in to change notification settings - Fork 117
Description
Hey, thanks for the tool, this is a really cool idea!
I'm running into a couple issues when using the plugin to import generated files. I get an "X layers couldn't be imported and were skipped." error in some cases. It generally still imports some of my layout and styles correctly but often fails to import things like background colors.
There are related issues on the sketch2story
project but it seems like these maybe need to resolve here. (I'm getting these errors without using that project but thought I'd share in case they were related):
- Sketch cannot import generated layers chrisvxd/story2sketch#59
- Address failing Sketch import chrisvxd/story2sketch#60
I was able to track down two root issues that were causing issues for me:
- If I don't set a font family and use the browser defaults the import will fail. Setting the font-family to a locally installed font fixed this error
- If I have background shapes html-sketchapp gives them a border of thickness null. Changing the thickness to 0 in my JSON solved that issue.
I'm not sure of the best fix for the font family issue... Maybe fetch the font the browser is actually using instead of the font defined in CSS?
The background shape issue seems easier to fix. Should we set the thickness to 0 instead of null? Or can we omit the border completely?
Let me know if I can help out. Thanks!
html-sketchapp version: 4.4.0
minimal example:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<h1>Hello World</h1>
<script src="etchasketch.js"></script>
</body>
</html>
screenshot from the browser:
screenshot from Sketch: