Ember-svg-shapes provides some basic shapes in the form of svg images, wrapped in ember components.
http://lozjackson.github.io/ember-svg-shapes/
ember install ember-svg-shapes
-
svg-circle
-
svg-square
-
svg-rectangle
-
svg-triangle
-
svg-star
All the parameters are optional.
Add css class names to the component and style as you would normally do with an svg element.
.svg-triangle.green {
fill: rgb(152, 208, 46);
}
If you get an error saying:
Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self'"
.
You need to add/modify the content security policy directive. In the config/environment.js
file you need to have 'unsafe-inline'
in the style-src
.
ENV.contentSecurityPolicy = {
'style-src': "'self' 'unsafe-inline'"
}
Ember version >= 1.13.13