HTML to Sketch export solution
data:
images by @simon360 πpublic setId(id: string);
)public setUserInfo(key: string, value: any, scope?: string): void;
public getUserInfo(key: string, scope?: string): any;
this info can then be pulled by other Sketch plugin and used e.g. to prepare more useful handoff for developers (e.g. including names/code of symbols used by designer).
new SymbolMaster({x: 10, y: 10, width: 100, height: 200}); //symbol size explicitly set
new SymbolMaster({x: 10, y: 10}); //symbol size will be automatically calculated based on its children sizes
do not include some of the optional, or deprecated, fields in the .asketch
output
[plugin] use build-in Sketch 'ui' module to show dialogs - https://developer.sketchapp.com/reference/api/#ui
[plugin] new success message
Somehow npm package was published w/o package.json and README.md. I have no idea how this is even possible π΅
This release is 90% handmade by @TheReincarnator πThank you!
If you were importing models (e.g. Page, Document, Text, SymbolMaster etc.) like so:
import Document from '@brainly/html-sketchapp/html2asketch/document';
import SymbolMaster from '@brainly/html-sketchapp/html2asketch/symbolMaster';
please update to:
import {Document, SymbolMaster} from '@brainly/html-sketchapp';
That's it β¨
nodeTreeToSketchGroup
- that walks given DOM subtree recursively and creates a tree of Sketch groups and layersnodeTreeToSketchPage
- that wraps nodeTreeToSketchGroup
and crates a page with an (optional) Artboard where all groups and layers are placedArtboard
objectindex.js
file that lets you import html-sketchapp
in a convenient wayimport {Document, Page, Text, nodeToSketchLayers} from '@brainly/html-sketchapp';
skipSystemFonts
optionsome websites or component libraries use font-family lists starting with OS-specific fonts, if the option 'skipSystemFonts' is enabled, we skip those fonts to choose a font Sketch is capable of.
getRectangleName
option that gives you full control over layer names<svg style='background:red'><circle></svg>
- circle will now be rendered in the front of red background (fix by @markdalgleish )Support for styling SVG containers by @markdalgleish
nodeToSketchLayers
is no longer asyncwhite-space
CSS property by @KimDal-hyeong<img src='pizza.svg' />
)<img srcset=
)nodeToSketchLayers
(it was crashing for some svg nodes, now the error is being caught)@skpm/build
to avoid security vuln in one of its depsnodeToSketchLayers
Symbol Instances - #63 by @mxmul Inline SVG support - #47 by @KimDal-hyeong, @jeroenransijn and @kdzwinel