Last active
September 10, 2018 15:02
-
-
Save ASH-Bryan/9c6c09667547361383ee8aabcadf5d4a to your computer and use it in GitHub Desktop.
utility-theming
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'; | |
import { computed } from '@ember/object'; | |
import { readOnly } from '@ember/object/computed'; | |
export default Ember.Component.extend({ | |
tagName: 'a', | |
classNames: ['mediaCard__link', 'site-linkColor'], | |
attributeBindings: ['href'], | |
href: readOnly('url') | |
}); |
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({ | |
tagName: 'h1', | |
classNames: ['mediaCard__title'] | |
}); |
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({ | |
}); |
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' | |
import { computed } from '@ember/object' | |
import { htmlSafe } from '@ember/string' | |
export default Ember.Component.extend({ | |
tagName: 'section', | |
classNames: ['mediaCard', 'site-borderRadius'], | |
classNameBindings: ['dark:mediaCard--dark'], | |
showDescription: false, | |
largeFab: false, | |
image: null, | |
headerBackground: computed('image', function() { | |
return this.image | |
? htmlSafe(`background-image: url("${this.image}");`) | |
: null | |
}), | |
headerClass: computed('image', function() { | |
return this.image ? `h-48` : '' | |
}), | |
fabStyle: computed('largeFab', function() { | |
return this.largeFab | |
? htmlSafe('top: -3rem; right: 1rem;') | |
: htmlSafe('top: -2.5rem; right: 1rem;') | |
}), | |
actions: { | |
toggleDescription() { | |
this.toggleProperty('showDescription') | |
} | |
} | |
}); |
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({ | |
tagName: '' | |
}).reopenClass({ | |
positionalParams: ['text'] | |
}); |
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: 'CSS Playground' | |
}); |
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({ | |
hasturDescription: `I found myself faced by names and terms that I had heard elsewhere in the most hideous of connections—Yuggoth, Great Cthulhu, Tsathoggua, Yog-Sothoth, R'lyeh, Nyarlathotep, Azathoth, Hastur, Yian, Leng, the Lake of Hali, Bethmoora, the Yellow Sign, L'mur-Kathulos, Bran and the Magnum Innominandum—and was drawn back through nameless aeons and inconceivable dimensions to worlds of elder, outer entity at which the crazed author of the Necronomicon had only guessed in the vaguest way.... There is a whole secret cult of evil men (a man of your mystical erudition will understand me when I link them with Hastur and the Yellow Sign) devoted to the purpose of tracking them down and injuring them on behalf of the monstrous powers from other dimensions.`, | |
yogLinks: [ | |
{ | |
name: 'Feed Me', | |
url: 'https://en.wikipedia.org/wiki/Yog-Sothoth' | |
}, | |
{ | |
name: 'Ask a Question', | |
url: 'https://en.wikipedia.org/wiki/Yog-Sothoth' | |
} | |
] | |
}); |
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 EmberRouter from '@ember/routing/router'; | |
import config from './config/environment'; | |
const Router = EmberRouter.extend({ | |
location: 'none', | |
rootURL: config.rootURL | |
}); | |
Router.map(function() { | |
this.route('demo') | |
}); | |
export default Router; |
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
/* Plumbing classes: These are not part of the fun */ | |
body { | |
padding: 0.25rem; | |
margin: 0.25rem; | |
} | |
.navButton { | |
border: 1px solid black; | |
padding: .3rem; | |
text-decoration: none; | |
color: blue; | |
} | |
.navButton.active { | |
color: white; | |
background-color: blue; | |
} | |
/* BEM classes */ | |
.mediaCard { | |
box-shadow: 0 2px 4px 0 rgba(0,0,0,0.10); | |
/* border-radius: .25rem; */ | |
} | |
.mediaCard--dark { | |
background-color: #606f7b; | |
color: white; | |
} | |
.mediaCard__header { | |
display: flex; | |
padding: 0.75rem; | |
align-items: flex-end; | |
} | |
.mediaCard__header--image { | |
height: 12rem; | |
color: white; | |
} | |
.mediaCard__body { | |
position: relative; | |
padding: 0.75rem; | |
} | |
.mediaCard__body--title { | |
padding-top: 1rem; | |
} | |
.mediaCard__links { | |
padding: 0.75rem; | |
border-top: 1px solid #dae1e7; | |
margin-top: 0.5rem; | |
padding-top: 0.5rem; | |
} | |
.mediaCard__link { | |
/* color: #f2d024; */ | |
text-decoration: none; | |
margin-right: 1.5rem; | |
} | |
.mediaCard__title { | |
display: flex; | |
justify-content: space-between; | |
margin: 0rem; | |
} | |
.mediaCard__button { | |
color: white; | |
background-color: #4dc0b5; | |
/* border-radius: .25rem; */ | |
display: flex; | |
} | |
.mediaCard__buttonContainer { | |
padding: 0.5rem; | |
height: 2rem; | |
display: flex; | |
align-items: center; | |
box-sizing: border-box; | |
} | |
.mediaCard__buttonContainer--flip { | |
flex-direction: row-reverse; | |
} | |
.mediaCard__buttonIcon { | |
fill: currentColor; | |
margin: 0 0.5rem; | |
} | |
.mediaCard__actionButton { | |
cursor: pointer; | |
} | |
.mediaCard__fabContainer { | |
position: absolute; | |
} | |
.faq { | |
margin-bottom: 1rem; | |
} | |
.faq__question { | |
font-weight: bold; | |
} |
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
/* | |
Defines the site customization contract as utility classes. | |
*/ | |
.site-linkColor { | |
color: green; | |
} | |
.site-borderRadius { | |
border-radius: 0.25rem; | |
} | |
.site-buttonColor { | |
background-color: navy; | |
} |
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
/* This could be SASS variable or whatever */ | |
:root { | |
--linkColor: red; | |
} | |
/* Global settings */ | |
a { | |
color: var(--linkColor); | |
} | |
/* Utility class overrides from base */ | |
.site-linkColor { | |
color: var(--linkColor); | |
} | |
.site-borderRadius { | |
border-radius: 1rem; | |
} |
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.15.0", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js", | |
"ember": "3.1.3", | |
"ember-template-compiler": "3.1.3", | |
"ember-testing": "3.1.3" | |
}, | |
"addons": { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment