Ember-custom-css-properties
WARNING: This addon is a proof of concept and should not be used in production yet!
Installation
ember install ember-custom-css-properties
Usage
You may define cssPropertyBindings
on all your components, just like attributeBindings
this will
set and bind your property to a custom css property.
Example:
Will result in an element like this:
You may define your own property name mapping using a colon:
Will result in an element like this:
Currently, javascript numbers, CSS number values and hex colors are treated as safe
by default,
anything else should be escaped using the Ember.String.htmlSafe()
function. Otherwise a warning will be
printed to your developer console.
Configuration
By default, this addon adds the ember-custom-css-properties
mixin to all components by default.
To disable this behaviour, you can set the addToAllComponents
in your config file at config/environment
to false
.
module { var ENV = // ... 'ember-custom-css-properties': addToAllComponents: false }
After disabling the mixin, you need to add it to all components which want to bind custom CSS properties.
Example:
Running Tests
npm test
(Runsember try:testall
to test your addon against multiple Ember versions)ember test
ember test --server