Skip to content

Instantly share code, notes, and snippets.

@krivaten
Created May 23, 2017 15:21
Show Gist options
  • Save krivaten/c8303c800cda4212ee8a97d9cbe609eb to your computer and use it in GitHub Desktop.
Save krivaten/c8303c800cda4212ee8a97d9cbe609eb to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
body {
margin: 12px 16px;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 12pt;
}
.input-demo {
display: inline-block;
position: relative;
height: 40px;
width: auto;
background: pink;
border: 1px solid gray;
padding: 4px 8px;
}
.input-demo-input,
.input-demo-display {
font: 14px/40px sans-serif;
padding: 0;
margin: 0;
min-width: 200px;
height: 40px;
background: transparent;
}
.input-demo-input {
position: absolute;
top: 4px;
left: 8px;
right: 8px;
bottom: 4px;
outline: none;
border: 0;
opacity: 0;
z-index: 1;
width: 100%;
}
.input-demo-input:focus {
opacity: 1;
}
.input-demo-input:focus ~ .input-demo-display {
opacity: 0;
}
.input-demo-display {
z-index: 0;
display: inline-block;
}
<h1>Pants... that is all.</h1>
<p>The container will grow as you type but has a min-width</p>
<div class="input-demo">
{{input value=myValue class="input-demo-input"}}
<span class="input-demo-display">{{myValue}}</span>
</div>
{
"version": "0.12.1",
"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.12.0",
"ember-template-compiler": "2.12.0",
"ember-testing": "2.12.0"
},
"addons": {
"ember-data": "2.12.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment