Skip to content

Instantly share code, notes, and snippets.

@megganeturner
Last active January 9, 2018 01:12
Show Gist options
  • Save megganeturner/0cd5631ae74f647cb7ed955f1d05456d to your computer and use it in GitHub Desktop.
Save megganeturner/0cd5631ae74f647cb7ed955f1d05456d to your computer and use it in GitHub Desktop.
Button Component
import Ember from 'ember';
export default Ember.Component.extend({
tagName: '',
});
import Ember from 'ember';
export default Ember.Component.extend({
tagName: '',
});
import Ember from 'ember';
export default Ember.Component.extend({
tagName: '',
});
import Ember from 'ember';
export default Ember.Component.extend({
tagName: '',
classNames: ['kit'],
attributeBindings: ['disabled', 'type', 'placeholder']
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
dummySelectItems: ['item 1', 'item 2', 'item 3']
});
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
body {
margin: 12px 16px;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 12pt;
}
.kit {
height: 30px;
line-height: 30px;
vertical-align: middle;
display: inline-block;
border: none;
border-radius: 2px;
background: transparent;
cursor: pointer;
}
.kit[disabled] {
background-color: #e9e9e9;
cursor: not-allowed;
color: #fff;
}
.kit[disabled] > svg > path,
.kit[disabled] > svg > g > rect,
.kit[disabled] > svg > g > path {
fill: #fff;
}
.input {
border-bottom: 1px solid #e9e9e9;
border-radius: 0;
padding: 0 1em;
-webkit-appearance: none;
}
.select {
background-image: url("https://image.flaticon.com/icons/svg/60/60781.svg");
background-position: 90% 50%;
background-repeat: no-repeat;
background-size: 12px;
padding-right: 26px;
}
.btn {
color: #fff;
padding: 0 2rem;
width: auto;
}
.flat {
border: 1px solid #209f85;
color: #000;
}
.flat[disabled] {
border: 1px solid #e9e9e9;
color: #e9e9e9;
background-color: transparent;
}
.flat:hover:not([disabled]) {
background-color: #209f85;
color: #fff;
transition: background-color 280ms cubic-bezier(0.115, 0.93, 0.465, 0.905);
}
.large {
height: 36px;
line-height: 36px;
min-width: 36px;
}
.icon {
width: 30px;
}
.icon > svg {
height: 100%;
width: 100%;
display: block;
margin: 0 auto;
}
.white {
background-color: #fff;
color: #000;
}
.mist {
background-color: #f7f9f7;
color: #000;
}
.mist > svg > g > .icon,
.white > svg > g > .icon {
fill: #000;
}
.black {
background-color: #000;
color: #fff;
}
.acqua {
background-color: #209f85;
color: #fff;
}
.acqua > svg > g > .icon,
.black > svg > g > .icon {
fill: #fff;
}
svg > g > #canvas {
fill: transparent;
}
{{#symbol-wrapper tagName='button' classNames='btn acqua'}}
click me
{{/symbol-wrapper}}
{{#symbol-wrapper tagName='button' classNames='btn acqua' disabled=true}}
click me
{{/symbol-wrapper}}
{{#symbol-wrapper tagName='button' classNames='btn flat'}}
click me
{{/symbol-wrapper}}
{{#symbol-wrapper tagName='button' classNames='btn flat' disabled=true}}
click me
{{/symbol-wrapper}}
{{#symbol-wrapper tagName='span' classNames='icon acqua'}}
{{down-arrow-svg}}
{{/symbol-wrapper}}
{{#symbol-wrapper tagName='span' classNames='icon acqua'}}
{{grid-svg}}
{{/symbol-wrapper}}
{{#symbol-wrapper tagName='span' classNames='icon black'}}
{{location-svg}}
{{/symbol-wrapper}}
{{#symbol-wrapper tagName='span' classNames='icon large mist'}}
{{down-arrow-svg}}
{{/symbol-wrapper}}
{{symbol-wrapper tagName='input' type='text' placeholder='helllooo' classNames='input'}}
{{#symbol-wrapper tagName='select' classNames='input select'}}
{{#each dummySelectItems as |option|}}
<option>{{option}}</option>
{{/each}}
{{/symbol-wrapper}}
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-5592 17620 35 35">
<g id="arrow" transform="translate(1902 34783)">
<rect id="canvas" class="canvas" width="35" height="35" transform="translate(-7459 -17128) rotate(180)"/>
<path id="icon" class="icon" d="M22.578,7.266,17.5,12.383,12.422,7.266l-.469.508,5.313,5.352h.469l5.313-5.352Z" transform="translate(-7494 -17155)"/>
</g>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-5637 17617 35 35">
<g id="grid" transform="translate(1855 34212)">
<path id="canvas" class="cls-1" d="M0,0H35V35H0Z" transform="translate(-7492 -16595)"/>
<g id="icon" class="icon" transform="translate(-7482 -16585)">
<rect id="Rectangle_4186" data-name="Rectangle 4186" width="4.2" height="4.2" transform="translate(0 0)"/>
<rect id="Rectangle_4191" data-name="Rectangle 4191" width="4.2" height="4.2" transform="translate(0 5.4)"/>
<rect id="Rectangle_4194" data-name="Rectangle 4194" width="4.2" height="4.2" transform="translate(0 10.8)"/>
<rect id="Rectangle_4187" data-name="Rectangle 4187" width="4.2" height="4.2" transform="translate(5.4 0)"/>
<rect id="Rectangle_4190" data-name="Rectangle 4190" width="4.2" height="4.2" transform="translate(5.4 5.4)"/>
<rect id="Rectangle_4193" data-name="Rectangle 4193" width="4.2" height="4.2" transform="translate(5.4 10.8)"/>
<rect id="Rectangle_4188" data-name="Rectangle 4188" width="4.2" height="4.2" transform="translate(10.8 0)"/>
<rect id="Rectangle_4189" data-name="Rectangle 4189" width="4.2" height="4.2" transform="translate(10.8 5.4)"/>
<rect id="Rectangle_4192" data-name="Rectangle 4192" width="4.2" height="4.2" transform="translate(10.8 10.8)"/>
</g>
</g>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-5542 17620 35 35">
<g id="location" data-name="location" transform="translate(-5697 16774)">
<g class="canvas">
<rect id="Rectangle_4416" data-name="Rectangle 4416" width="35" height="35" transform="translate(155 846)"/>
</g>
<path class="icon" d="M16.906,6.344a1.442,1.442,0,1,0-.422.984A1.349,1.349,0,0,0,16.906,6.344Zm-2.25,0a.84.84,0,1,1,.246.6A.814.814,0,0,1,14.656,6.344Zm.844,8.332.211-.281q3.727-4.676,3.727-7.488a4.214,4.214,0,0,0-1.16-2.971,3.732,3.732,0,0,0-5.555-.018,4.2,4.2,0,0,0-1.16,2.988,7.388,7.388,0,0,0,.932,3.164,21.567,21.567,0,0,0,1.723,2.953,14.53,14.53,0,0,0,1.072,1.371Zm0-11.426a3.126,3.126,0,0,1,2.391,1.072,3.686,3.686,0,0,1,.984,2.584q0,2.391-3.375,6.855Q12.125,9.3,12.125,6.906a3.686,3.686,0,0,1,.984-2.584A3.126,3.126,0,0,1,15.5,3.25Zm3.094,7.875v.563h2.355l2.777,5.063H7.273l2.777-5.062h2.355v-.562H9.7l-3.41,6.188H24.711L21.3,11.125Z" transform="translate(157 854)"/>
</g>
</svg>
{
"version": "0.13.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.16.2",
"ember-template-compiler": "2.16.2",
"ember-testing": "2.16.2"
},
"addons": {
"ember-data": "2.16.3"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment