Use glamor in your Ember project.
ember install ember-glamor
import Ember from 'ember';
import hbs from 'htmlbars-inline-precompile';
import { css } from 'glamor';
const styles = {
red: css({
backgroundColor: 'red'
}),
blueGreen: css({
backgroundColor: 'blue',
':hover': {
backgroundColor: 'green'
}
})
};
export default Ember.Component.extend({
styles,
layout: hbs`
<div class={{styles.red}}>
This is red.
</div>
<div class={{styles.blueGreen}}>
This is blue, and green on hover.
</div>
`
});
speedy mode is enabled in production and is disabled otherwise. You can override in config/environment.js
:
if (environment === 'test') {
ENV.glamor.speedy = true;
}
yarn install && bower install
yarn test
(Runsember try:each
to test your addon against multiple Ember versions)ember test
ember test --server
ember build
For more information on using ember-cli, visit https://ember-cli.com/.