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"
.
- Ember.js v3.24 or above
- Ember CLI v3.24 or above
- Node.js v12 or above
ember install ember-style-modifier
It expects CSS declarations as named arguments or as a hash as positional
argument. Property names are supported in dasherized as well as in camelCase
spelling. Value must be a string or undefined
. You may set a priority by
adding an "!important"
suffix.
You may pass multiple hashes as positional arguments and combine hashes with named arguments. If multiple hashes are passed and contain CSS declarations for the same property, last one wins. If hashes and named arguments declare same property, named argument wins.
Adding styles to pseudo-elements is not supported.
See the Contributing guide for details.
This project is licensed under the MIT License.