Styling modal dialogs
Setting styles on the view model
Most of the time you will be able to satisfy styling requirements by adding and removing classes to the modal.
For maximum flexibility, replace the modal template or bypass the PHP Modal view model completely (the next page Styling modal dialogs contains examples).
Transformations and transitions
By default, the following transitions are applied to modals (via the attributes
These values can be changed by supplying a configuration object to the
hyva.modal() function call.
In the following example, the modal is scaled in instead of the default fade effect.
It is fine to only specify a subset of the values if the default are sufficient.
What is the duration used for?
duration value is required to match the transformation or transition duration (in ms) when the modal is hidden.
The modal will ignore subsequent calls to hide further modals until
duration ms have passed since the previous time
hide was called.
If the value of
duration is shorter than the hide transition, the stack state might get confused and modals might still be visible even though the internal modal stack property is empty.