Sketch.artboards¶
This is an auxiliary module that allows to set or override some export settings specifically for the 'artboards' mode. Moreā¦
Properties¶
Unique properties
The properties unique for this exporting mode (non-existing in Sketch.export) are marked below with bold font.
background:stringexportPageAsFallback:boolformats:stringListgroupContentsOnly:boolincludeSymbols:boolitems:stringListoutputDir:stringoverwrite:boolsaveForWeb:boolscales:varListsingleCore:booltrimmed:booluseIdForName:bool
Detailed Description¶
This module, as well as the rest of auxiliary modules such as Sketch.layers, Sketch.pages, and Sketch.preview, plays only a helping role. It allows to attach some properties to your products or groups that are later used by the rules defined in the main Sketch.export module.
File Tags¶
This module doesn't set or use any tags.
Property Documentation¶
background¶
-
Allows to set/override the background color to use when exporting slices. Replaces any background specified in the document.
Allowed values:
- color literal (
'#rgb','#rgba','#rrggbb', or'#rrggbbaa') -
color name
List of all names
Name Color HEX aliceblue #f0f8ffantiquewhite #faebd7aqua #00ffffaquamarine #7fffd4azure #f0ffffbeige #f5f5dcbisque #ffe4c4black #000000blanchedalmond #ffebcdblue #0000ffblueviolet #8a2be2brown #a52a2aburlywood #deb887cadetblue #5f9ea0chartreuse #7fff00chocolate #d2691ecoral #ff7f50cornflowerblue #6495edcornsilk #fff8dccrimson #dc143ccyan #00ffffdarkblue #00008bdarkcyan #008b8bdarkgoldenrod #b8860bdarkgray #a9a9a9darkgreen #006400darkgrey #a9a9a9darkkhaki #bdb76bdarkmagenta #8b008bdarkolivegreen #556b2fdarkorange #ff8c00darkorchid #9932ccdarkred #8b0000darksalmon #e9967adarkseagreen #8fbc8fdarkslateblue #483d8bdarkslategray #2f4f4fdarkslategrey #2f4f4fdarkturquoise #00ced1darkviolet #9400d3deeppink #ff1493deepskyblue #00bfffdimgray #696969dimgrey #696969dodgerblue #1e90fffirebrick #b22222floralwhite #fffaf0forestgreen #228b22fuchsia #ff00ffgainsboro #dcdcdcghostwhite #f8f8ffgold #ffd700goldenrod #daa520gray #808080green #008000greenyellow #adff2fgrey #808080honeydew #f0fff0hotpink #ff69b4indianred #cd5c5cindigo #4b0082ivory #fffff0khaki #f0e68clavender #e6e6falavenderblush #fff0f5lawngreen #7cfc00lemonchiffon #fffacdlightblue #add8e6lightcoral #f08080lightcyan #e0fffflightgoldenrodyellow #fafad2lightgray #d3d3d3lightgreen #90ee90lightgrey #d3d3d3lightpink #ffb6c1lightsalmon #ffa07alightseagreen #20b2aalightskyblue #87cefalightslategray #778899lightslategrey #778899lightsteelblue #b0c4delightyellow #ffffe0lime #00ff00limegreen #32cd32linen #faf0e6magenta #ff00ffmaroon #800000mediumaquamarine #66cdaamediumblue #0000cdmediumorchid #ba55d3mediumpurple #9370dbmediumseagreen #3cb371mediumslateblue #7b68eemediumspringgreen #00fa9amediumturquoise #48d1ccmediumvioletred #c71585midnightblue #191970mintcream #f5fffamistyrose #ffe4e1moccasin #ffe4b5navajowhite #ffdeadnavy #000080oldlace #fdf5e6olive #808000olivedrab #6b8e23orange #ffa500orangered #ff4500orchid #da70d6palegoldenrod #eee8aapalegreen #98fb98paleturquoise #afeeeepalevioletred #db7093papayawhip #ffefd5peachpuff #ffdab9peru #cd853fpink #ffc0cbplum #dda0ddpowderblue #b0e0e6purple #800080red #ff0000rosybrown #bc8f8froyalblue #4169e1saddlebrown #8b4513salmon #fa8072sandybrown #f4a460seagreen #2e8b57seashell #fff5eesienna #a0522dsilver #c0c0c0skyblue #87ceebslateblue #6a5acdslategray #708090slategrey #708090snow #fffafaspringgreen #00ff7fsteelblue #4682b4tan #d2b48cteal #008080thistle #d8bfd8tomato #ff6347turquoise #40e0d0violet #ee82eewheat #f5deb3white #ffffffwhitesmoke #f5f5f5yellow #ffff00yellowgreen #9acd32 -
rgb/rgbafunctionFor example:
'rgb(128, 0, 255)','rgba(50%, 0, 100%, 50%)'. -
hsl/hslafunctionFor example:
'hsl(270deg, 100%, 50%)','hsla(270, 100, 50, 0.5)'
Default:
undefined - color literal (
exportPageAsFallback¶
-
If a page contains no artboards, export that page instead.
Default:
false
formats¶
-
The format in which assets are generated. If you set this value, it will override your export presets in the documents.
Tip
If empty list is provided, then the default sketchtool's behavior is used, i.e. it generates PNG images.
Allowed values:
'png'|'jpg'|'tiff'|'webp'|'pdf'|'eps'|'svg'Default:
[]
groupContentsOnly¶
-
Export only layers that are contained within the group.
Default:
false
includeSymbols¶
-
When exporting artboards, include the ones that represent symbols.
Default:
false
items¶
-
List of artboard/slice names or IDs to export. You can retrieve the IDs from the metadata. If you specify this value, it will override the export presets defined in the document.
Tip
If empty list is provided, then the default sketchtool's behavior is used which is to generate assets for all exportable artboards/slices.
Default:
[]
outputDir¶
-
If you set this property, the assets are exported to folder with this name relatively to
workingDir. In other words, the resulting filename is prepended byoutputDir/.Default:
undefined
overwrite¶
-
Set this to true to allow to overwrite existing files with newly generated once.
I couldn't make it work
I tried this parameter with the sketchtool, however, it had no influence. Maybe it doesn't work or maybe I did something wrong.
Default:
false
saveForWeb¶
-
Export web-ready images. Setting this option to
truestrips out additional file data from some images, such as EXIF metadata and color profiles.Default:
false
scales¶
-
Scales to be used for exporting of assets. This allows you to scale pictures up (@2x, @3x, @4x, etc.) or down (@0.5x, @0.25x, etc.). You can provide a single value or a list. If you specify this value, it will override the export presets defined in the document.
Floating-point scaling factor
It appears that sketchtool allows to use floats only when scaling down, i.e. for \(0 < scale < 1\). If you try to set this property to something like 2.5, the fractional part is trancated.
Tip
If empty list is provided, then the default sketchtool's behavior is used: all assets are exported according to the presets defined in the document or as
@1x.Default:
[]
singleCore¶
-
By default, sketchtool utilises all cores available on the system to get the exports done as soon as possible, but this can be overriden with this property.
Default:
false
trimmed¶
-
Export images trimmed.
Default:
false
useIdForName¶
-
Name exported images using their ID rather than their name.
You can also retrieve the IDs from the metadata.
Default:
false