Permalink
Browse files

add theme config option, add sky theme, fix line-height of <small>

  • Loading branch information...
1 parent e3f3e9d commit 90f343e5bddb663f061a2c2f40eac352b52601b8 @hakimel hakimel committed Aug 30, 2012
Showing with 209 additions and 13 deletions.
  1. +2 −1 css/main.css
  2. +169 −0 css/theme/sky.css
  3. +18 −1 index.html
  4. +9 −1 js/reveal.js
  5. +11 −10 js/reveal.min.js
View
@@ -233,8 +233,9 @@ body {
}
.reveal small {
+ display: inline-block;
font-size: 0.6em;
- line-height: 1em;
+ line-height: 1.2em;
vertical-align: top;
}
View
@@ -0,0 +1,169 @@
+/**
+ * Sky theme for reveal.js presentations.
+ *
+ * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se
+ */
+
+/*********************************************
+ * FONT-FACE DEFINITIONS
+ *********************************************/
+
+@import url(http://fonts.googleapis.com/css?family=Quicksand:400,700,400italic,700italic);
+@import url(http://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700);
+
+
+
+/*********************************************
+ * GLOBAL STYLES
+ *********************************************/
+
+body {
+ font-family: 'Open Sans', sans-serif;
+ font-size: 36px;
+ font-weight: 200;
+ letter-spacing: -0.02em;
+ color: #333;
+
+ background: #f7fbfc;
+ background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPHJhZGlhbEdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgY3g9IjUwJSIgY3k9IjUwJSIgcj0iNzUlIj4KICAgIDxzdG9wIG9mZnNldD0iMCUiIHN0b3AtY29sb3I9IiNmN2ZiZmMiIHN0b3Atb3BhY2l0eT0iMSIvPgogICAgPHN0b3Agb2Zmc2V0PSIxMDAlIiBzdG9wLWNvbG9yPSIjYWRkOWU0IiBzdG9wLW9wYWNpdHk9IjEiLz4KICA8L3JhZGlhbEdyYWRpZW50PgogIDxyZWN0IHg9Ii01MCIgeT0iLTUwIiB3aWR0aD0iMTAxIiBoZWlnaHQ9IjEwMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
+ background: -moz-radial-gradient(center, ellipse cover, #f7fbfc 0%, #add9e4 100%);
+ background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%,#f7fbfc), color-stop(100%,#add9e4));
+ background: -webkit-radial-gradient(center, ellipse cover, #f7fbfc 0%,#add9e4 100%);
+ background: -o-radial-gradient(center, ellipse cover, #f7fbfc 0%,#add9e4 100%);
+ background: -ms-radial-gradient(center, ellipse cover, #f7fbfc 0%,#add9e4 100%);
+ background: radial-gradient(ellipse at center, #f7fbfc 0%,#add9e4 100%);
+}
+
+::-moz-selection {
+ background:rgba(79, 64, 28, 0.99);
+ color: white;
+}
+::-webkit-selection {
+ background:rgba(79, 64, 28, 0.99);
+ color: white;
+}
+::selection {
+ background:rgba(79, 64, 28, 0.99);
+ color: white;
+}
+
+
+/*********************************************
+ * HEADERS
+ *********************************************/
+
+.reveal h1,
+.reveal h2,
+.reveal h3,
+.reveal h4,
+.reveal h5,
+.reveal h6 {
+ margin: 0 0 20px 0;
+ color: #333;
+ font-family: 'Quicksand', sans-serif;
+ line-height: 0.9em;
+ letter-spacing: -0.08em;
+
+ text-transform: uppercase;
+}
+
+
+/*********************************************
+ * LINKS
+ *********************************************/
+
+.reveal a:not(.image) {
+ color: #3b759e;
+ text-decoration: none;
+
+ -webkit-transition: color .15s ease;
+ -moz-transition: color .15s ease;
+ -ms-transition: color .15s ease;
+ -o-transition: color .15s ease;
+ transition: color .15s ease;
+}
+ .reveal a:not(.image):hover {
+ text-shadow: none;
+ border: none;
+ border-radius: 2px;
+ }
+
+.reveal .roll span:after {
+ color: #fff;
+ background: #3b759e;
+}
+
+
+/*********************************************
+ * MISC
+ *********************************************/
+
+.reveal section img {
+ margin: 30px 0 0 0;
+ background: rgba(255,255,255,0.12);
+ border: 1px solid #ddd;
+
+ -webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
+ -moz-box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
+ box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
+
+ -webkit-transition: all .2s linear;
+ -moz-transition: all .2s linear;
+ -ms-transition: all .2s linear;
+ -o-transition: all .2s linear;
+ transition: all .2s linear;
+}
+
+ .reveal a:hover img {
+ background: rgba(255,255,255,0.2);
+ border-color: #3b759e;
+
+ -webkit-box-shadow: 0 0 20px rgba(0, 0, 0, 0.55);
+ -moz-box-shadow: 0 0 20px rgba(0, 0, 0, 0.55);
+ box-shadow: 0 0 20px rgba(0, 0, 0, 0.55);
+ }
+
+.reveal blockquote {
+ background: rgba(255, 255, 255, 0.4);
+}
+
+.reveal code {
+ background: rgba(255, 255, 255, 0.6);
+}
+
+.reveal p {
+ margin-bottom: 20px;
+}
+
+
+/*********************************************
+ * NAVIGATION CONTROLS
+ *********************************************/
+
+.reveal .controls a {
+ color: #fff;
+}
+ .reveal .controls a.enabled {
+ color: #3b759e;
+ text-shadow: 0px 0px 2px hsla(185, 45%, 70%, 0.3);
+ }
+
+
+/*********************************************
+ * PROGRESS BAR
+ *********************************************/
+
+.reveal .progress {
+ background: rgba(0,0,0,0.2);
+}
+ .reveal .progress span {
+ background: #3b759e;
+
+ -webkit-transition: width 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985);
+ -moz-transition: width 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985);
+ -ms-transition: width 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985);
+ -o-transition: width 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985);
+ transition: width 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985);
+ }
+
+
View
@@ -15,7 +15,7 @@
<link href='http://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/main.css">
- <link rel="stylesheet" href="css/theme/default.css">
+ <link rel="stylesheet" href="css/theme/default.css" id="theme">
<!-- For syntax highlighting -->
<link rel="stylesheet" href="lib/css/zenburn.css">
@@ -151,6 +151,22 @@ <h2>Transition Styles</h2>
</ul>
</section>
+ <section>
+ <h2>Themes</h2>
+ <p>
+ Reveal.js comes with a few themes built in: <br>
+ <a href="http://lab.hakim.se/reveal-js/?theme=sky">Sky</a> |
+ <a href="http://lab.hakim.se/reveal-js/?theme=beige">Beige</a> |
+ <a href="http://lab.hakim.se/reveal-js/?theme=simple">Simple</a> |
+ <a href="http://lab.hakim.se/reveal-js/">Default</a>
+ </p>
+ <p>
+ <small>
+ * Theme demos are loaded after the presentation which leads to flicker. In production you should load your theme in the <code>&lt;head&gt;</code> using a <code>&lt;link&gt;</code>.
+ </small>
+ </p>
+ </section>
+
<section>
<section data-state="alert">
<h2>Global State</h2>
@@ -296,6 +312,7 @@ <h3>BY Hakim El Hattab / hakim.se</h3>
progress: true,
history: true,
+ theme: Reveal.getQueryHash().theme || 'default', // available themes are in /css/theme
transition: Reveal.getQueryHash().transition || 'default', // default/cube/page/concave/linear(2d)
// Optional libraries used to extend on reveal.js
View
@@ -1,5 +1,5 @@
/*!
- * reveal.js 2.0 r20
+ * reveal.js 2.0 r21
* http://lab.hakim.se/reveal-js
* MIT licensed
*
@@ -39,6 +39,9 @@ var Reveal = (function(){
// Apply a 3D roll to links on hover
rollingLinks: true,
+ // Transition style (see /css/theme)
+ theme: 'default',
+
// Transition style
transition: 'default', // default/cube/page/concave/linear(2d),
@@ -111,6 +114,7 @@ var Reveal = (function(){
extend( config, options );
// Cache references to DOM elements
+ dom.theme = document.querySelector( '#theme' );
dom.wrapper = document.querySelector( '.reveal' );
dom.progress = document.querySelector( '.reveal .progress' );
dom.progressbar = document.querySelector( '.reveal .progress span' );
@@ -222,6 +226,10 @@ var Reveal = (function(){
dom.progress.style.display = 'block';
}
+ if( config.theme && dom.theme ) {
+ dom.theme.setAttribute( 'href', 'css/theme/' + config.theme + '.css' );
+ }
+
if( config.transition !== 'default' ) {
dom.wrapper.classList.add( config.transition );
}
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit 90f343e

Please sign in to comment.