Skip to content

Convert Sketch SymbolMaster overrideProperties into PBDLOverrideProperties #31

@ivan-015

Description

@ivan-015

In Sketch, we are already given the overrideProperties that can be overridden by Symbolinstances. Therefore, these OverrideProperties can be mapped relatively directly.

The following image is a sample SymbolMaster from Sketch's JSON

Screen Shot 2021-07-13 at 3 04 09 PM

For each overrideProperty, we have access to the overrideName and canOverride.

Firstly, Parabeac-Core shall only convert override properties with canOverride set to `true.

Secondly, we need to extract some information from the overrideName.

  • The first thing we need is the UUID of the overridable element. This is the String to the left of the _(underscore). This string will be mapped to the UUID property of the PBDLOverrideProperty
  • The second thing we need is the type of the overridable property. This is the String to the right of the _(underscore). This string will be used to determine the type of overridable property.

Thirdly, for each OverrideProperty, we need to perform a lookup to find the default value of the property. This can be done by traversing the layers of the symbol master and finding the UUID that matches the UUID inside of overrideName (discussed above). This will allow us to populate the properties value for each overridableProperty.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions