diff --git a/docs/_assets/components.svg b/docs/_assets/components.svg new file mode 100644 index 00000000..067f6b2b --- /dev/null +++ b/docs/_assets/components.svg @@ -0,0 +1,26 @@ + + + + components + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/_assets/components_mo.svg b/docs/_assets/components_mo.svg new file mode 100644 index 00000000..b906f109 --- /dev/null +++ b/docs/_assets/components_mo.svg @@ -0,0 +1,26 @@ + + + + components_mo + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/_assets/customize.svg b/docs/_assets/customize.svg new file mode 100644 index 00000000..258cd240 --- /dev/null +++ b/docs/_assets/customize.svg @@ -0,0 +1,23 @@ + + + + Group + Created with Sketch. + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/_assets/customize_mo.svg b/docs/_assets/customize_mo.svg new file mode 100644 index 00000000..d5704fc0 --- /dev/null +++ b/docs/_assets/customize_mo.svg @@ -0,0 +1,23 @@ + + + + mo + Created with Sketch. + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/_assets/index.js b/docs/_assets/index.js new file mode 100644 index 00000000..ced17403 --- /dev/null +++ b/docs/_assets/index.js @@ -0,0 +1,8 @@ +(function() { + Array.prototype.forEach.call(document.querySelectorAll('[data-target]'), function(el) { + var target = el.getAttribute('data-target'); + el.addEventListener('click', function() { + location.href = target; + }); + }); +})(); diff --git a/docs/_assets/logo.svg b/docs/_assets/logo.svg new file mode 100644 index 00000000..fc1429a8 --- /dev/null +++ b/docs/_assets/logo.svg @@ -0,0 +1,17 @@ + + + + MDL logo + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/docs/_assets/main.css b/docs/_assets/main.css index 6cecf665..d47f360a 100644 --- a/docs/_assets/main.css +++ b/docs/_assets/main.css @@ -1,6 +1,241 @@ -.mdl-layout__content { - padding: 20px; +html > body { + font-family: 'Roboto', 'Helvetica', 'Arial', sans-serif !important; } +.mdl-layout__header { + height: 50vh; + align-items: flex-start; + padding: 32px; + flex-shrink: 0; +} +.mdl-layout-title { + font-weight: 300; + text-transform: uppercase; + line-height: 1.5em; + font-size: 1rem; +} +.mdl-layout-title a { + font-weight: inherit; +} +.mdl-layout__header { + background-size: auto 30%; + background-repeat: no-repeat; + background-position: center center; + box-shadow: none !important; +} +.about .mdl-layout__header { + background-color: #37474f; + background-image: url('logo.svg'); +} +.about .mdl-navigation { + background-color: #37474f; +} +.templates .mdl-layout__header { + background-color: #00ACC2; + background-image: url('templates.svg'); +} +.templates .mdl-navigation { + background-color: #00ACC2; +} +.components .mdl-layout__header { + background-color: #E90974; + background-image: url('components.svg'); +} +.components .mdl-navigation { + background-color: #E90974; +} +.styles .mdl-layout__header { + background-color: #8F4099; + background-image: url('styles.svg'); +} +.styles .mdl-navigation { + background-color: #8F4099; +} +.customize .mdl-layout__header { + background-color: #191E80; + background-image: url('customize.svg'); +} +.customize .mdl-navigation { + background-color: #191E80; +} +.mdl-navigation { + box-shadow: none !important; + border: 0 !important; + padding: 0; + width: 100%; + height: 64px; + flex-shrink: 0; +} +.mdl-navigation a { + font-weight: 300; + line-height: 64px; + padding: 0 24px; + color: white; + box-sizing: border-box; + border-bottom: 3px solid transparent; +} +.mdl-navigation a:hover { + background-color: inherit; +} +.mdl-navigation a:not(.download) { + opacity: 0.65; +} +.mdl-navigation a.download { + text-decoration: none; + margin-right: 24px; +} +.mdl-navigation a.download button { + margin-left: 8px; +} +.mdl-navigation a.download .mdl-icon { + color: black; + opacity: 0.5; +} +.about .mdl-navigation .about, +.templates .mdl-navigation .templates, +.components .mdl-navigation .components, +.styles .mdl-navigation .styles, +.customize .mdl-navigation .customize { + opacity: 1; + border-bottom-color: #18FFFF; +} +.mdl-layout__content { + overflow: visible; +} +.mdl-layout__content > section.download { + width: 100%; + height: 6rem; + font-size: 1.5rem; + display: flex; + justify-content: center; + align-items: center; +} +.mdl-layout__content > section.download > a { + font-weight: 300; + text-transform: uppercase; +} +.mdl-layout__content > footer { + height: 120px; +} +.mdl-mini-footer { + flex-direction: column; + align-items: stretch; + justify-content: center; +} +.mdl-mini-footer ul { + padding: 0; + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; +} +.mdl-mini-footer ul > * { + margin: 0 8px; +} + +.about-panel { + box-sizing: border-box; + width: 100%; + flex-grow: 1; +} +.about-panel--text { + padding: 100px; + margin: 0 auto; + width: 100%; + line-height: 2em; +} +.about-panel--text dl { + width: 100%; + display: flex; + flex-direction: row; + justify-content: center; + align-items: stretch; +} +.about-panel--text dl dt { + text-align: right; + vertical-align: top; + width: 33%; + margin-right: 24px; +} +.about-panel--text dl dd { + text-align: left; + vertical-align: top; + width: 66%; + margin: 0; + margin-left: 24px; +} +.about-panel--components, +.about-panel--styles, +.about-panel--customize, +.about-panel--templates { + height: 500px; + display: flex; + flex-direction: column; + align-items: center; + justify-content: flex-end; + padding: 40px; + color: white; + text-transform: uppercase; + font-size: 1.6rem; + width: auto; + background-repeat: no-repeat; + background-position: center center; + background-size: auto 50%; + cursor: pointer; +} +.about-panel--templates { + background-color: #B3E0E1; + background-image: url(/assets/templates.svg); +} +.about-panel--templates:hover { + background-image: url(/assets/templates_mo.svg); +} +.about-panel--components { + background-color: #E90974; + background-image: url(/assets/components.svg); +} +.about-panel--components:hover { + background-image: url(/assets/components_mo.svg); +} +.about-panel--styles { + background-color: #8F4099; + background-image: url(/assets/styles.svg); +} +.about-panel--styles:hover { + background-image: url(/assets/styles_mo.svg); +} +.about-panel--customize { + background-color: #191E80; + background-image: url(/assets/customize.svg); +} +.about-panel--customize:hover { + background-image: url(/assets/customize_mo.svg); +} + +.templates .content { + max-width: 1280px; +} +.templates .mdl-layout__content .content { + padding: 72px 0; +} +.template { + width: 100%; + margin-bottom: 72px; +} +.template > .template__meta a { + color:inherit; +} +.template > .template__preview { + background-position: center center; + background-size: cover; + min-height: 30vh; +} +.template.template--product > .template__preview { + background-image: url('/assets/template_product.jpg'); +} +.template.template--general > .template__preview { + background-image: url('/assets/template_general.jpg'); +} + .mdl-layout__content p { font-size: 15px; @@ -46,33 +281,3 @@ button a { color: inherit; text-decoration: none; } - -/* TOC */ - -.chapter-toc h1 { - font-size: 15px; - line-height: 16px; - padding-bottom: 12px; - font-weight: 400; - color: #757575; -} - -.chapter-toc { - border-left: 5px solid #e1bee7; - padding-left: 20px; -} - -.chapter-toc ul { - list-style: none; - margin-top: 0; - padding-left: 0; -} - -.chapter-toc li:last-child { - line-height: 20px; - padding-top: 10px; -} - -.chapter-toc li { - line-height: 40px; -} diff --git a/docs/_assets/mo.svg b/docs/_assets/mo.svg new file mode 100644 index 00000000..bf26f896 --- /dev/null +++ b/docs/_assets/mo.svg @@ -0,0 +1,22 @@ + + + + mo + Created with Sketch. + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/_assets/styles.svg b/docs/_assets/styles.svg new file mode 100644 index 00000000..1b692043 --- /dev/null +++ b/docs/_assets/styles.svg @@ -0,0 +1,24 @@ + + + + styles + Created with Sketch. + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/_assets/styles_mo.svg b/docs/_assets/styles_mo.svg new file mode 100644 index 00000000..54877034 --- /dev/null +++ b/docs/_assets/styles_mo.svg @@ -0,0 +1,24 @@ + + + + styles_mo + Created with Sketch. + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/_assets/template_blog.jpg b/docs/_assets/template_blog.jpg new file mode 100644 index 00000000..48d7c97a Binary files /dev/null and b/docs/_assets/template_blog.jpg differ diff --git a/docs/_assets/template_dashboard.jpg b/docs/_assets/template_dashboard.jpg new file mode 100644 index 00000000..534f736f Binary files /dev/null and b/docs/_assets/template_dashboard.jpg differ diff --git a/docs/_assets/template_general.jpg b/docs/_assets/template_general.jpg new file mode 100644 index 00000000..d01548be Binary files /dev/null and b/docs/_assets/template_general.jpg differ diff --git a/docs/_assets/template_product.jpg b/docs/_assets/template_product.jpg new file mode 100644 index 00000000..4962d3ee Binary files /dev/null and b/docs/_assets/template_product.jpg differ diff --git a/docs/_assets/templates.svg b/docs/_assets/templates.svg new file mode 100644 index 00000000..112de8c4 --- /dev/null +++ b/docs/_assets/templates.svg @@ -0,0 +1,16 @@ + + + + Path 1 + Path 1 + Path 1 + Created with Sketch. + + + + + + + + + + + \ No newline at end of file diff --git a/docs/_assets/templates_mo.svg b/docs/_assets/templates_mo.svg new file mode 100644 index 00000000..19a0e202 --- /dev/null +++ b/docs/_assets/templates_mo.svg @@ -0,0 +1,16 @@ + + + + Path 1 + Path 1 + Path 1 + Created with Sketch. + + + + + + + + + + + \ No newline at end of file diff --git a/docs/_pages/components.md b/docs/_pages/components.md index 2ef70b8e..b5398315 100644 --- a/docs/_pages/components.md +++ b/docs/_pages/components.md @@ -1,5 +1,5 @@ --- layout: components title: Components +bodyclass: components --- - diff --git a/docs/_pages/customize.md b/docs/_pages/customize.md index da8c75ba..e97895ec 100644 --- a/docs/_pages/customize.md +++ b/docs/_pages/customize.md @@ -1,6 +1,7 @@ --- layout: customize title: Customize & Download +bodyclass: customize --- diff --git a/docs/_pages/index.md b/docs/_pages/index.md index 31c616c1..8c95a159 100644 --- a/docs/_pages/index.md +++ b/docs/_pages/index.md @@ -1,24 +1,36 @@ --- -layout: page -title: Welcome +layout: layout +bodyclass: about --- + +
+
+
Material Design Lite
+
+ Material Design Lite lets you add a [Material Design](http://google.com/design/spec) look and feel to your static content websites. It doesn’t rely on any JavaScript frameworks and aims to optimise for cross-device use, gracefully degrade in older browsers and offer an experience that is accessible from the get-go. +
+
+
+
+ Templates +
-Material Design Lite lets you add a [Material Design](http://google.com/design/spec) look and feel to your static content websites. It doesn’t rely on any JavaScript frameworks and aims to optimise for cross-device use, gracefully degrade in older browsers and offer an experience that is accessible from the get-go. +
+ Esse dolor ullamco ipsum enim aliquip minim. Sunt ullamco excepteur laboris nulla sunt. Consequat labore irure sint cillum aute labore est cupidatat eu. Culpa sint do non amet quis quis fugiat laboris sit sint id Lorem. Dolor adipisicing eu nostrud eiusmod sint consequat enim est velit et non mollit minim. +
-Download Package +
+ Components +
+
+ Styles +
+
+ Customize +
- -Material Shapes - -## Cross-device by default - -Develop with a single underlying system for your site that allows for a unified experience across platforms and device sizes. Mobile precepts are fundamental, but touch, mouse, and keyboard are all first-class input methods. - -## Built with BEM & Sass - -Material Design Lite provides vanilla CSS. Our source utilises Sass, the popular CSS preprocessor and BEM - [the front-end naming methodology](https://github.com/google/material-design-lite/wiki/Understanding-BEM). Quickly get started with the pre-built CSS or build the source yourself. - -## Components - -With Material Design Lite, you get dozens of custom HTML and CSS components. They're documented, lightweight and bring the beauty of Material Design to content sites. +
+ Cillum magna sit ea exercitation excepteur enim pariatur ex deserunt. Deserunt aute nisi in laboris anim proident sunt enim pariatur quis. Aliqua anim voluptate veniam ad eiusmod ullamco deserunt. Laborum duis proident ipsum ex velit sint sint veniam amet eu Lorem. Nostrud adipisicing consequat deserunt magna consectetur pariatur culpa qui do. Ex dolor incididunt laborum ex ea non ea incididunt labore laboris minim consequat cillum. Proident nisi pariatur amet velit exercitation Lorem officia irure occaecat in deserunt. Tempor enim culpa do eu ipsum consequat irure amet officia. +
+ diff --git a/docs/_pages/styles.md b/docs/_pages/styles.md new file mode 100644 index 00000000..15f83ad6 --- /dev/null +++ b/docs/_pages/styles.md @@ -0,0 +1,5 @@ +--- +layout: layout +title: Styles +bodyclass: styles +--- diff --git a/docs/_pages/templates.md b/docs/_pages/templates.md new file mode 100644 index 00000000..05841be0 --- /dev/null +++ b/docs/_pages/templates.md @@ -0,0 +1,18 @@ +--- +layout: templates +title: Templates +bodyclass: templates +templates: + - name: product + title: Product + description: Laborum quis laboris veniam minim labore id excepteur. + - name: blog + title: Blog + description: Deserunt dolor dolore ut excepteur tempor occaecat aliqua sunt eu velit incididunt irure irure in. + - name: general + title: Universal + description: Esse irure aliqua amet ullamco aliqua ullamco est exercitation adipisicing nisi laborum sit labore voluptate. + - name: dashboard + title: Dashboard + description: Non laboris consequat ullamco aute cillum ad. +--- diff --git a/docs/_templates/layout.html b/docs/_templates/layout.html index 2f2996b6..5890a534 100644 --- a/docs/_templates/layout.html +++ b/docs/_templates/layout.html @@ -37,43 +37,56 @@ - - -
-
-
- - - - Material Design Lite - -
- - -
-
- Material Design Lite - + +
+
+ Material
Design
Lite
+
+
+ +
+ + +
-
- {% block content %}{% endblock %} -
-
+ + +
+
+ {% block content %} + {{content|safe}} + {% endblock %} +
+
+ Download Kit +
+ +
diff --git a/docs/_templates/templates.html b/docs/_templates/templates.html new file mode 100644 index 00000000..e97b6078 --- /dev/null +++ b/docs/_templates/templates.html @@ -0,0 +1,27 @@ +{% extends 'layout.html' %} +{% block content %} +{% for template in page.templates %} +
+
+

{{ template.title }}

+

+ {{ template.description }} +

+ + + Download + + + + Preview + +
+
+
+
+{% endfor %} +{% endblock %} diff --git a/gulpfile.js b/gulpfile.js index 7381411f..458fd041 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -245,14 +245,6 @@ gulp.task('test:visual', function() { */ var site = {}; - -/** - * Compiled swig templates cache. - * @type {Object} - */ -var templates = {}; - - /** * Generates an HTML file based on a template and file metadata. */ @@ -263,14 +255,10 @@ function applyTemplate() { page: file.page, content: file.contents.toString() }; - // If template not in template cache, compile and add it. - if (!templates[file.page.layout]) { - var templateFile = path.join( - __dirname, 'docs', '_templates', file.page.layout + '.html'); - $.util.log('Compiling template:', $.util.colors.yellow(file.page.layout)); - templates[file.page.layout] = swig.compileFile(templateFile); - } - var tpl = templates[file.page.layout]; + + var templateFile = path.join( + __dirname, 'docs', '_templates', file.page.layout + '.html'); + var tpl = swig.compileFile(templateFile, {cache: false}); file.contents = new Buffer(tpl(data), 'utf8'); this.push(file); cb(); @@ -284,7 +272,7 @@ function applyTemplate() { gulp.task('components', function() { return gulp.src('./src/**/README.md', {base: './src'}) // Add basic front matter. - .pipe($.header('---\nlayout: component\n---\n\n')) + .pipe($.header('---\nlayout: component\nbodyclass: components\n---\n\n')) .pipe($.frontMatter({property: 'page', remove: true})) .pipe($.marked()) .pipe((function () { @@ -351,6 +339,10 @@ gulp.task('pages', ['components'], function() { */ gulp.task('assets', function () { return gulp.src(['docs/_assets/**']) + .pipe($.if(/\.(svg|jpg|png)$/i, $.imagemin({ + progressive: true, + interlaced: true + }))) .pipe(gulp.dest('docs/out/assets')); }); @@ -358,7 +350,7 @@ gulp.task('assets', function () { /** * Serves the landing page from "out" directory. */ -gulp.task('serve', ['assets', 'pages', 'demos', 'templates'], function () { +gulp.task('serve', ['scripts', 'styles', 'assets', 'pages', 'demos', 'templates'], function () { browserSync({ notify: false, server: { @@ -375,6 +367,7 @@ gulp.task('serve', ['assets', 'pages', 'demos', 'templates'], function () { gulp.watch(['src/**/*.html'], ['demos', reload]); gulp.watch(['src/**/README.md'], ['components', reload]); gulp.watch(['templates/**/*'], ['templates', reload]); + gulp.watch(['docs/**/*', '!docs/out/**/*'], ['pages', 'assets', reload]); }); gulp.task('publish', ['default', 'templates', 'assets', 'pages', 'demos'], function() {