ember-style-modifier
This addon provides a {{style}}
element modifier to set element's style.
This allows to set custom CSS of an element without requiring a Content Security Policy style-src-attr: "unsafe-inline"
.
Compatibility
It supports the same versions as ember-functional-modifiers
does.
Installation
ember install ember-style-modifier
Usage
<p {{style "border" "1px"}} {{style "padding" "1em" "important"}}></p>
Public API is designed after CSSStyleDeclaration.setProperty()
method.
It expects a property name as first and value as second positional argument.
Style is removed if value is undefined
.
You may pass a priority as third argument, which must be "important"
if provided.
Warning: You should not pass a dynamic property name as it doesn't remove
existing style rules if property name changes.
Contributing
See the Contributing guide for details.
License
This project is licensed under the MIT License.