Skip to content

Instantly share code, notes, and snippets.

@TRMW
Last active February 15, 2017 00:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save TRMW/76adbd1186c23d3a4bb0d36aa06f3d05 to your computer and use it in GitHub Desktop.
Save TRMW/76adbd1186c23d3a4bb0d36aa06f3d05 to your computer and use it in GitHub Desktop.
Additive class vs. classNames
import Ember from 'ember';
export default Ember.Component.extend({
classNames: ['base-class'],
style: 'border: solid 2px blue'
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
.base-class {
border: solid 3px blue;
padding: 20px;
margin-bottom: 20px;
}
.outer-class {
box-shadow: inset 0 0 0 3px red;
}
{{my-component classNames='outer-class'}}
{{my-component class='outer-class'}}
{{component 'my-component' classNames='outer-class'}}
{{component 'my-component' class='outer-class'}}
{
"version": "0.11.0",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "2.4.5",
"ember-data": "2.11.0",
"ember-template-compiler": "2.4.5",
"ember-testing": "2.4.5"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment