Last active
August 22, 2018 23:25
-
-
Save ASH-Bryan/cbc2478e97b9b480260d66aeade3c1b6 to your computer and use it in GitHub Desktop.
css-oocss
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: ['link'], | |
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: ['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, getProperties } from '@ember/object' | |
import { htmlSafe } from '@ember/string' | |
export default Ember.Component.extend({ | |
tagName: 'section', | |
classNames: ['mediaCard'], | |
classNameBindings: ['skin'], | |
showDescription: false, | |
largeFab: false, | |
image: null, | |
skin: computed('image', 'fab', 'largeFab', 'dark', | |
'description', 'bodyTitle', 'links', function() { | |
const { image, fab, largeFab, dark, description, bodyTitle, links } = | |
getProperties(this, 'image', 'fab', 'largeFab', 'dark', 'description', 'bodyTitle', 'links') | |
//Have to do the most complex first | |
return (image && largeFab && bodyTitle) | |
? 'imageLinksBigfabBelowtitle' | |
: (image && fab) | |
? 'imageLinksFab' | |
: (image && links) | |
? 'imageLinks' | |
: (dark && links) | |
? 'darkLinks' | |
: (description) | |
? 'reveal' | |
: '' | |
}), | |
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('faq') | |
}); | |
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; | |
} | |
/* OOCSS mediaCard */ | |
.mediaCard { | |
box-shadow: 0 2px 4px 0 rgba(0,0,0,0.10); | |
border-radius: .25rem; | |
} | |
.hd { | |
display: flex; | |
padding: 0.75rem; | |
align-items: flex-end; | |
} | |
.bd { | |
position: relative; | |
padding: 0.75rem; | |
} | |
.links { | |
padding: 0.75rem; | |
border-top: 1px solid #dae1e7; | |
margin-top: 0.5rem; | |
padding-top: 0.5rem; | |
} | |
.link { | |
color: #f2d024; | |
text-decoration: none; | |
margin-right: 1.5rem; | |
} | |
.title { | |
display: flex; | |
justify-content: space-between; | |
margin: 0rem; | |
} | |
.actionBtn { | |
cursor: pointer; | |
} | |
.fabContainer { | |
position: absolute; | |
} | |
/* mediaCard skins */ | |
.reveal .hd { | |
height: 12rem; | |
color: white; | |
} | |
.darkLinks.mediaCard { | |
background-color: #606f7b; | |
color: white; | |
} | |
.imageLinks .hd { | |
height: 12rem; | |
color: white; | |
} | |
.imageLinksFab .hd { | |
height: 12rem; | |
color: white; | |
} | |
.imageLinksBigfabBelowtitle .bd { | |
padding-top: 1rem; | |
} | |
.imageLinksBigfabBelowtitle .hd { | |
height: 12rem; | |
color: white; | |
} | |
/* OOCSS buttons */ | |
.btn { | |
color: white; | |
background-color: #4dc0b5; | |
border-radius: .25rem; | |
display: flex; | |
} | |
.cont { | |
padding: 0.5rem; | |
height: 2rem; | |
display: flex; | |
align-items: center; | |
box-sizing: border-box; | |
} | |
.icon { | |
fill: currentColor; | |
margin: 0 0.5rem; | |
} | |
/* button skins */ | |
.flip .cont { | |
flex-direction: row-reverse; | |
} | |
/* FAQ */ | |
.faq { | |
margin-bottom: 1rem; | |
} | |
.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
{ | |
"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