Organize your shared styles using the layers list, create a hierarchy where children inherit properties from their parent.
Organize your shared styles using the layers list, create a hierarchy where children inherit properties from their parent.
Requires Sketch >= 53
setup
command which creates 2 new pages: Text Styles
and Layer Styles
.Let's say you have 4 text styles: Button/Primary
, Button/Secondary
, Header/H1
and Header/H2
.
You should have 2 groups: Button
and Header
with 3 text layers in each: Primary
(or H1
), Secondary
(or H2
) and __default
.
You now have multiple possible actions (each triggered after changing the selection):
Header
group to Heading
will change Header/H1
to Heading/H1
and Header/H2
to Heading/H2
)Inverted
from Button/Secondary
will rename Button/Secondary
to Button/Inverted/Secondary
and create a new __default
layer)Now you might wonder what the __default
layers are for, and that's where the magic comes in :sparkles:
__default
layer and press cmd + shift + ,
to be able to select which style properties its children should inherit (the __default
is linked to a group, so the children are the children of the parent group of the __default
layer)__default
style, the children will change as well