Skip to content

Commit

Permalink
Improve addon and bring it to latest standards
Browse files Browse the repository at this point in the history
  • Loading branch information
bakerac4 committed Dec 11, 2018
1 parent c0f6248 commit 608590d
Show file tree
Hide file tree
Showing 8 changed files with 163 additions and 157 deletions.
148 changes: 0 additions & 148 deletions addon/styles/ember-floating-labels.scss

This file was deleted.

100 changes: 100 additions & 0 deletions app/styles/ember-floating-labels.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
@import 'ember-floating-labels/variables';

.floating-label {
position: relative;
input,
select {
padding: 0.94em 12px;
}

select {
padding-right: 16px;
-webkit-appearance:none;
-moz-appearance:none;
}

&.has-focus,
&.has-content {
input, textarea {
padding-top: 1.5em;
padding-bottom: 0.38em;
}
select {
padding-top: 0.7em;
padding-bottom: 0;
&.input-lg {
padding-top: 0.4em;
}
}
.control-label {
top: 5px;
margin-top: 0;
opacity: 1;
transform: perspective(1px) scale(.75);
}
}
.control-label {
position: absolute;
z-index: 1;
top: 50%;
left: 14px;
margin-top: -7px;
font-size: 14px;
line-height: 14px;
font-weight: normal;
transition: all 450ms cubic-bezier(.23, 1, .32, 1) 0ms;
transform: translate3d(0, 0, 0) scale(1);
transform-origin: left top 0;
pointer-events: none;
opacity: 0.6;
.floating-label-textarea & {
top: 12px;
margin-top: 0;
}
}
.form-control::placeholder {
opacity: 0;
transition: all 350ms cubic-bezier(0.23, 1, 0.32, 1) 0ms;
}
&.is-disabled .form-control::placeholder,
.form-control:focus::placeholder {
opacity: 1;
}
}

/* only show custom indicator arrow in webkit/firefox */
@media screen and (-webkit-min-device-pixel-ratio:0) {
.floating-label-select:after {
content: " ";
position: absolute;
display: inline-block;
width: 0;
height: 0;
top: 0;
bottom: 0;
right: 8px;
margin: auto;
border-style: solid;
border-width: 7px 4px 0 4px;
border-color: #ccc transparent transparent transparent;
pointer-events: none;
}
}

@-moz-document url-prefix() {
.floating-label-select:after {
content: " ";
position: absolute;
display: inline-block;
width: 0;
height: 0;
top: 0;
bottom: 0;
right: 8px;
margin: auto;
border-style: solid;
border-width: 7px 4px 0 4px;
border-color: #ccc transparent transparent transparent;
pointer-events: none;
}
}
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict';

module.exports = {
name: require('./package').name,
included: function(/* app */) {
this._super.included.apply(this, arguments);
}
name: 'ember-floating-labels',
included: function(/* app */) {
this._super.included.apply(this, arguments);
}
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"broccoli-asset-rev": "^2.7.0",
"ember-ajax": "^3.1.0",
"ember-cli": "~3.5.1",
"ember-cli-autoprefixer": "^0.8.1",
"ember-cli-changelog": "^0.3.4",
"ember-cli-dependency-checker": "^3.0.0",
"ember-cli-eslint": "^4.2.3",
Expand Down
Empty file removed tests/unit/.gitkeep
Empty file.
4 changes: 2 additions & 2 deletions tests/unit/mixins/fl-input-actions-test.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import Ember from 'ember';
import EmberObject from '@ember/object';
import FlInputActionsMixin from 'fl-input/mixins/fl-input-actions';
import { module, test } from 'qunit';

module('Unit | Mixin | fl input actions');

// Replace this with your real tests.
test('it works', function(assert) {
let FlInputActionsObject = Ember.Object.extend(FlInputActionsMixin);
let FlInputActionsObject = EmberObject.extend(FlInputActionsMixin);
let subject = FlInputActionsObject.create();
assert.ok(subject);
});
Loading

0 comments on commit 608590d

Please sign in to comment.