: Exporting a slice in Sketch with transparent background around Using Sketch 3 want to export an icon, the icons themselves are 24x24 but they sit within an area of 32x32. I've figured out how
Using Sketch 3 want to export an icon, the icons themselves are 24x24 but they sit within an area of 32x32.
I've figured out how to do it by combining two different layers one 24x24 and the other 32x32 but it's a tedious process. I need to do this for every single icon.
Is there a faster workflow?
More posts by @Rivera951
5 Comments
Sorted by latest first Latest Oldest Best
It's actually very easy if you know how to do it :)
Suppose you have an icon that is 24x24px and you want the png to be 32x32px. You have to create a slice over the icon. The slice must be 32x32px. Then group the slice and the icon together. Last but not least: click on the slice and in the inspector you will see something like this:
Make sure you check "Export Group Contents Only". The other options must be unchecked.
This way, you will export a transparent png, even if there isn't a transparent background under the icon.
This method worked for me: Place the correct size slice layer above the layer your icon is on and make sure they are not grouped.
Hope it helps
Use this to export your assets. The issue with Sketch itself and most other plugins is that it neglects invisible layers while exporting. As a result, invisible bounds do not work.
I even tried to decrease a bound's opacity to 0 so to try to trick Sketch into exporting it. But Sketch's native export isn't so naive.
You might see a horde of plugins of Sketch that help in exporting assets for Android easily. They might reduce the steps involved, but it doesn't solve the bounds problem.
This one does.
github.com/GeertWille/sketch-export-assets
It allows you to export assets for iOS, Android and Windows for all resolutions while keeping the bounds intact.
Saves all that artboard efforts.
If you want to export only the icon layer (24x24) just drag the layer to the desktop.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.