On Github alienresident / open-apereo-2014
I am using reveal.js for my slides. They're on githubhttps://github.com/alienresident/Sakai-Meet-Morpheus
I'll post a PDF of these slides afterwards to Lanyrd.Mark ReillyUser Experience DesignerNew York University.
So Let's start with the 5 Ws: Who, What, Where, When, and most importantly Why! Before we get into the How! WHO: am I? [down]Templates we're committed in FebruarySass is under active development
WHEN: can I get it? [next]Need to use a CSS preprocessor
Sass was my choice
Apache Velocity templates
<!DOCTYPE html> <html lang="en-US"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1">
<!--[if lt IE 9]> <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7/html5shiv.min.js"></script> <![endif]-->
<!--[if (lt IE 9)]> <link href="/library/skin/morpheus-default/portal-ie.css" rel="stylesheet"> <![endif]--> <!--[if (gte IE 9)|(IEMobile)|(!IE)]><!--> <link href="/library/skin/morpheus-default/portal.css" rel="stylesheet"> <!--<![endif]-->
<script src="${pageSkinRepo}/${pageSkin}/js/morpheus.scripts.js"></script>
Add your own javascript to your skin!
<script src="library/morpheus-default/js/morpheus.scripts.js"></script>
Discrete snippets of markup that are conditionally called throughout the templates.
learn more at sass-lang.com/guide
$instution-color: #fc3; a { color: $instution-color; } nav { background-color: $instution-color; }
@mixin default-type-size { font-size: 16px; line-height: 1.5em; } p { @include default-type-size; } footer { @include default-type-size; }
p { font-size: 16px; line-height: 1.5em; } footer { font-size: 16px; line-height: 1.5em; }
@mixin default-type-size($color) { font-size: 16px; color: $color; } p { @include default-type-size(#333); } footer { @include default-type-size(#eee); }
p { font-size: 16px; color: #333333; } footer { font-size: 16px; color: #eeeeee; }
@mixin type-size($size, $color) { font-size: $size; color: $color; } p { @include type-size(16px, #333); } footer { @include type-size(14px, #eee); }
p { font-size: 16px; color: #333333; } footer { font-size: 14px; color: #eeeeee; }
%default-type-size { font-size: 16px; line-height: 1.5em; } p { @extend %default-type-size; } footer { @extend %default-type-size; }
p, footer { font-size: 16px; line-height: 1.5em; }
%default-type-size { font-size: 16px; line-height: 1.5em; } p { @extend %default-type-size; } footer { @extend %default-type-size; color: #eeeeee; }
p, footer { font-size: 16px; line-height: 1.5em; } footer { color: #eeeeee; }
nav { ul { margin: 0; padding: 0; list-style: none; li { display: inline-block; } } }
nav ul { margin: 0; padding: 0; list-style: none; } nav ul li { display: inline-block; }
// _reset.scss html, body, ul, ol { margin: 0; padding: 0; }
// base.scss @import 'reset'; body { font-size: 100% Helvetica, sans-serif; background-color: #efefef; }
/* base.css */ html, body, ul, ol { margin: 0; padding: 0; } body { font-size: 100% Helvetica, sans-serif; background-color: #efefef; }
Sass while powerful can be misused. You can create brittle, inflexible, and unmaintainable CSS with Sass as with vanilla CSS.
What you need is an architecture that is modular and scalable.
By Jonathan Snook a web developer and designer, formerly at Yahoo!, He worked on the redesign of Yahoo! mail
learn more at smacss.com
At the very core of SMACSS is categorization
There are five types of categories:
Base Layout Module State ThemeBase rules are the defaults.
html, body, form { margin: 0; padding: 0; } input[type="text"] { border: 1px solid #999; } a { color: #039; } a:hover { color: #03C; }
Layout rules divide the page into sections. Layouts hold one or more modules together.
#article { width: 80%; float: left; } #sidebar { width: 20%; float: right; } .l-fixed #article { width: 600px; } .l-fixed #sidebar { width: 200px; }
Modules are the reusable, modular parts of our design. They are the callouts, the sidebar sections, the product lists and so on.
.pod { width: 100%; background: #ddd; } .pod input[type=text] { width: 50%; border: 1px solid #666; }
.pod { width: 100%; background: #ddd; } .pod input[type=text] { width: 50%; border: 1px solid #666; } .pod-callout { width: 200px; } .pod-callout input[type=text] { width: 180px; }
<div class="pod pod-callout"> ... </div>
State rules are ways to describe how our modules or layouts will look when in a particular state. Is it hidden or expanded? Is it active or inactive?
.tab { background-color: purple; color: white; } .is-tab-active { background-color: white; color: black; }
Theme rules are similar to state rules in that they describe how modules or layouts might look.
/* in module-name.css */ .mod { border: 1px solid; } /* in theme.css */ .mod { border-color: blue; }
In MORPHEUS we are combining the best of SMACSS & SASS
To get Scalable and Modular Architecture for SASS or SMASASS or SMACASS To get Scalable and Modular Architecture for SASS or SMASASS or SMACASS
Let's just stick to MORPHEUS!
/reference/trunk/library/src/webapp/skin/
morpheus-default/ morpheus-examp-u/ morpheus-master/ morpheus-rtl/
morpheus-default/ // generated css morpheus-examp-u/ // generated css morpheus-master/ // Sass files and compile script morpheus-rtl/ // generated css
@import "modules/MODULE_NAME/_MODULE_NAME";
morpheus-master/sass/modules/MODULE_NAME/_MODULE_NAME.scss
A more realistic example:
@import "modules/alerts/_alerts";
morpheus-master/sass/modules/alerts/_alerts.scss
Optionally there might import additional files more files
@import "_MODULE_NAME_variables"; // default variables that can be overridden @import "_MODULE_NAME_mixins"; // mixins for that module only @import "_MODULE_NAME_extendables"; // extendables for that module only
In our previous example it would pull in these files
morpheus-master/sass/modules/alerts/_alerts_variables.scss morpheus-master/sass/modules/alerts/_alerts_mixins.scss morpheus-master/sass/modules/alerts/_alerts_extendables.scss
## Sakai 10 sakai.properties portal.templates=morpheus portal.neoprefix= skin.default=morpheus-default
Morpheus will ship with 3 themes.
morpheus-default morpheus-examp-u morpheus-rtlmorpheus-master/sass/themes/
_morpheus-default.scss _morpheus-examp-u.scss _morpheus-rtl.scss
_morpheus-nyu.scss
Examples of Basic Customizations.
Institution Colors Logos Button Colors../sass/themes/_morpheus-default.scss
$primary-color: #009dce; $black-value: #333;
$masthead-image: "my-U-logo.png";
$button-gradient-stop-1: $primary-color; $button-gradient-stop-2: shade($button-gradient-stop-1, 3%);
Example of More Advanced Customizations.
Webfonts Icon Fonts$fontstack: 'Helvetica Neue', Helvetica, Arial, sans-serif; $webfont-name: 'Open Sans';
$icon-font-name: 'Sakai-Icon-Font'; $tool-icons: (sakai-motd '\f015') (sakai-schedule '\f073') ... ;
Custom Icon font based off of Font-Awesome using icomoon. All the portal assets icluding the font SVGs will be on github github.com/alienresident/sakai-portal-assets
Example of More Advanced Customizations contd
3. Custom Modules
@import "modules/CUSTOM_MODULE_NAME/_CUSTOM_MODULE_NAME";
../sass/modules/CUSTOM_MODULE_NAME/_CUSTOM_MODULE_NAME.scss
Each skin comes with a flat HTML file that acts as a styleguide. This is also a design pattern for sakai elements.
This is where you can see your stlyed elements on one page. Here's an example from NYU Classes. http://i5.nyu.edu/~mar22/nyuclasses/styleguide/
I'll be adding more Sakai components to these.
One each styleguide comes with a generated color guide. These are created using one base color and uses color theory models to create a color model. Let's look at color scheme designer
$primary-color: #009dce; $black-value: #333; $cs-primary: $primary-color; $cs-scheme: triad; // Options: mono, complement, triad, tetrad, analogic, accented-analogic $cs-hue-offset: 60; // $colour-stack-amounts: 25%, 50%, 75%, 85%, 90%; $black: tint-stack($black-value); $primary: tint-stack(cs-primary()); $secondary: tint-stack(cs-secondary()); $tertiary: tint-stack(cs-tertiary()); $quadrary: tint-stack(cs-quadrary());
Thanks to Gonzalo Silverio and the NYU Classes team at NYU
Questions?
Contributors?