Function applyVisualEdgeInsets
-
applyVisualEdgeInsets(
node: HTMLElement,
options?: VisualEdgeInsetsOptions,
): ActionReturn<VisualEdgeInsetsOptions>Parameters
- node: HTMLElement
Target element.
Optionaloptions: VisualEdgeInsetsOptionsAction Options.
Returns ActionReturn<VisualEdgeInsetsOptions>
Action Lifecycle functions.
- node: HTMLElement
Provides a Svelte action that applies inline styles for
paddingto a parent element orabsolute positioningto the action element adjusting for any painted borders defined by CSSborder-imageproperties of the target node / element of this action.When enabled, this action computes the effective visual edge insets / painted border using #runtime/util/dom/style!StyleMetric.getVisualEdgeInsets and applies these constraints to either
paddingor absolute inline styles so the element aligns correctly within the visible (non-border) content area of its container.Additionally, this action subscribes to #runtime/util/dom/theme!ThemeObserver and updates constraint calculations when any global theme is changed. To force an update of constraint calculations provide and change a superfluous / dummy property in the action options.
You may also provide no
actionoption, but provide astoreand the visual edge constraint calculations will be updated in the store with no inline styles applied to an element.