Skip to content

Instantly share code, notes, and snippets.

@jamesarosen
Last active June 8, 2016 20:15
Show Gist options
  • Save jamesarosen/509dae889c0dbef742cee5c3f647b98d to your computer and use it in GitHub Desktop.
Save jamesarosen/509dae889c0dbef742cee5c3f647b98d to your computer and use it in GitHub Desktop.
Form Styling 2
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;
}
form-field {
align-items: center;
display: flex;
flex-wrap: wrap;
width: 100%;
}
form-field + form-field {
margin-top: 1.5em;
}
form-field label {
flex: 0 0 27%;
font-face: Raleway;
font-size: 1.2em;
padding-right: 1.5em;
text-align: right;
}
form-field input {
border: 1px solid #999;
border-radius: 4px;
flex: 1;
font-size: 1em;
padding: 0.5em;
}
form-field input:focus {
box-shadow: 0 0 0 1px white,
0 0 0 3px #147FBD;
outline: 0;
}
form-field ::placeholder {
color: #a0a0a0;
font-style: italic;
}
form-field form-field-port-divider::before {
content: ":";
display: block;
flex: 0 0 1em;
margin-left: 0.25em;
margin-right: 0.25em;
}
form-field input.port { flex: 0 0 3em; width: 3em; }
form-field form-field-indicator {
color: orange;
flex: 0 0 1em;
padding-left: 0.5em;
}
form-field form-field-status {
color: #b0b0b0;
flex: 0 0 5em;
font-size: 0.88em;
padding-left: 0.5em;
}
form-field-help {
color: #a0a0a0;
display: block;
flex-basis: 100%;
font-weight: 300;
font-size: 0.9em;
letter-spacing: 0.3px;
margin-left: calc(27% + 2em);
margin-right: 7em;
margin-top: 0.8em;
}
form-field-help strong {
color: #707070;
font-weight: inherit;
}
.form-actions {
border-top: 1px solid #ccc;
margin-top: 1.5em;
padding-top: 1.5em;
padding-left: calc(27% + 1.8em);
padding-right: 6.5em;
}
.form-actions .btn + .btn { margin-left: 1em; }
input[type=submit], input[type=button] {
border-radius: 4px;
border: 1px solid;
cursor: pointer;
display: inline-block;
font-size: 0.95em;
padding: 0.75em 1em;
}
input[type=submit][disabled], input[type=button][disabled] {
background-color: #ccc;
border-color: #ccc;
color: white;
cursor: not-allowed;
}
input.btn-cancel {
background-color: white;
border-color: white;
color: #ccc;
}
input.btn-cancel:hover, input.btn-cancel:focus {
border-color: #ccc;
}
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{outlet}}
<br>
<br>
<form class='fui-form'>
<form-field>
<label for='description'>Description</label>
<input id='description' value='Stream non-SSL Papertrail Logs' autofoxcus />
<form-field-indicator>✅</form-field-indicator>
<form-field-status>Required</form-field-status>
<form-field-help>The name of your logs such as <strong>My cache logs</strong></form-field-help>
</form-field>
<form-field>
<label for='host'>Papertrail Address</label>
<input id='host' placeholder='Host' />
<form-field-port-divider />
<input id='port' placeholder='Port' class='port' />
<form-field-indicator>*</form-field-indicator>
<form-field-status>Required</form-field-status>
<form-field-help>In your Papertrail account, this information is at the top of your settings.</form-field-help>
</form-field>
<form-field>
<label for='format'>Log Format</label>
<input id='format' value='%h %l %u %t %r %>s' />
<form-field-indicator>✅</form-field-indicator>
<form-field-status>Default</form-field-status>
<form-field-help>An Apache-style string or VCL variables for log formatting.</form-field-help>
</form-field>
<footer class='form-actions'>
<input type='submit' value='CREATE' disabled class='btn' />
<input type='button' value='CANCEL' class='btn btn-cancel' />
</footer>
</form>
{
"version": "0.8.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.5.1",
"ember-data": "2.5.2",
"ember-template-compiler": "2.5.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment