Contents

applyStyle(_:)

Applies the CSS typing style to the current selection.

Declaration

func applyStyle(_ style: DOMCSSStyleDeclaration!)

Parameters

  • style:

    The style to apply to the current selection.

Discussion

This method does nothing if there is no current selection or if the current selection is collapsed.

This method hides the complexities of applying styles to elements. If necessary, this method will make multiple passes over the range of the current selection to ensure that the requested style is applied to the elements in that range, and takes into account the complexities of CSS style application rules. This method also simplifies styling attributes so that the minimum number of styling directives are used to yield a given computed style.

See Also

Getting and Setting CSS Properties