-
Notifications
You must be signed in to change notification settings - Fork 1
creating new morph
Pawel Przezwanski edited this page Jan 28, 2020
·
2 revisions
To create new morph please use morphFactory. The best way to learn how it work is to study already created morphs. MorphFactory accepts two arguments:
- morph unique name
- morph config
Morph config options:
- type: string
- default: 'transform'
- specifies which css property will be modified and transitioned by this morph.
- type: function
- default: undefined
- specifies how morph's property will be changed. Its input object can be destructured like this: { morphName, options, config, picture, gallery }
If propertyValue returns a string it will be treated as common value for all molecules. If propertyValue returns a function it has to have single argument - molecule object. This function will be iterated with all molecules and calculated css. During this iteration we can read data from molecule objects.
- type: function
- default value: undefined
- a function that returns cssText that is not main property
- type: object
- default: null,
- specifies this morph specific options default values