Last active
March 4, 2016 20:31
-
-
Save lukesargeant/7458f598e571ae3f16dd to your computer and use it in GitHub Desktop.
Multi-line label select
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
options: Ember.A([ | |
'Multi-line option one', | |
'Multi-line option two', | |
'Multi-line option three', | |
]) | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
classNames: ['label-select'], | |
tagName: 'label', | |
value: Ember.computed('options', function() { | |
return this.get('options').objectAt(0); | |
}) | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
margin: 12px 16px; | |
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; | |
font-size: 12pt; | |
} | |
.label-select { | |
position: relative; | |
display: inline-block; | |
padding-right: 10px; | |
width: 100px; | |
} | |
.label-select:hover { | |
color: #777; | |
} | |
.label-select select { | |
position: absolute; | |
top: 0; | |
width: 100%; | |
bottom: 0; | |
left: 0; | |
background: transparent; | |
border: 0 none; | |
-webkit-appearance: none; | |
-moz-appearance: none; | |
font-size: 0; | |
} | |
.label-select select option { | |
font-size: 12px; | |
} | |
.label-select::after { | |
display: inline-block; | |
content: ''; | |
font-size: 0; | |
width: 0; | |
height: 0; | |
border-left: 4px solid transparent; | |
border-right: 4px solid transparent; | |
border-top: 7px solid black; | |
margin-bottom: 1px; | |
margin-left: 3px; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.6.1", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.3.1/ember.debug.js", | |
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.3.3/ember-data.js", | |
"ember-template-compiler": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.2.0/ember-template-compiler.js" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment