mirror of
https://github.com/moparisthebest/mail
synced 2025-02-16 07:00:09 -05:00
Add basic layout and styling to styleguide
This commit is contained in:
parent
69ed386765
commit
8807830122
29
Gruntfile.js
29
Gruntfile.js
@ -97,6 +97,11 @@ module.exports = function(grunt) {
|
||||
'src/css/read-sandbox.css': 'src/sass/read-sandbox.scss',
|
||||
'src/css/all.css': 'src/sass/all.scss'
|
||||
}
|
||||
},
|
||||
styleguide: {
|
||||
files: {
|
||||
'src/css/styleguide.css': 'src/sass/styleguide.scss'
|
||||
}
|
||||
}
|
||||
},
|
||||
autoprefixer: {
|
||||
@ -108,6 +113,11 @@ module.exports = function(grunt) {
|
||||
'src/css/read-sandbox.css': 'src/css/read-sandbox.css',
|
||||
'src/css/all.css': 'src/css/all.css'
|
||||
}
|
||||
},
|
||||
styleguide: {
|
||||
files: {
|
||||
'src/css/styleguide.css': 'src/css/styleguide.css'
|
||||
}
|
||||
}
|
||||
},
|
||||
csso: {
|
||||
@ -119,6 +129,11 @@ module.exports = function(grunt) {
|
||||
'dist/css/read-sandbox.min.css': 'src/css/read-sandbox.css',
|
||||
'dist/css/all.min.css': 'src/css/all.css'
|
||||
}
|
||||
},
|
||||
styleguide: {
|
||||
files: {
|
||||
'dist/styleguide/css/styleguide.min.css': 'src/css/styleguide.css'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@ -457,7 +472,7 @@ module.exports = function(grunt) {
|
||||
|
||||
assemble: {
|
||||
options: {
|
||||
assets: '../',
|
||||
assets: 'dist',
|
||||
layoutdir: 'src/styleguide/layouts',
|
||||
layout: 'default.hbs',
|
||||
partials: ['src/styleguide/blocks/**/*.hbs'],
|
||||
@ -465,6 +480,9 @@ module.exports = function(grunt) {
|
||||
'handlebars-helper-compose',
|
||||
'src/styleguide/helpers/**/*.js'
|
||||
],
|
||||
data: [
|
||||
'dist/manifest.json'
|
||||
],
|
||||
flatten: true
|
||||
},
|
||||
styleguide: {
|
||||
@ -497,7 +515,7 @@ module.exports = function(grunt) {
|
||||
watch: {
|
||||
css: {
|
||||
files: ['src/sass/**/*.scss'],
|
||||
tasks: ['dist-css', 'dist-styleguide', 'manifest']
|
||||
tasks: ['dist-css', 'manifest', 'dist-styleguide']
|
||||
},
|
||||
styleguide: {
|
||||
files: ['src/styleguide/**/*.hbs', 'src/styleguide/**/*.js'],
|
||||
@ -638,7 +656,7 @@ module.exports = function(grunt) {
|
||||
grunt.loadNpmTasks('assemble');
|
||||
|
||||
// Build tasks
|
||||
grunt.registerTask('dist-css', ['sass', 'autoprefixer', 'csso']);
|
||||
grunt.registerTask('dist-css', ['sass:dist', 'autoprefixer:dist', 'csso:dist']);
|
||||
grunt.registerTask('dist-js', ['browserify', 'exorcise', 'ngtemplates', 'concat', 'uglify']);
|
||||
grunt.registerTask('dist-js-app', [
|
||||
'browserify:app',
|
||||
@ -666,8 +684,9 @@ module.exports = function(grunt) {
|
||||
]);
|
||||
grunt.registerTask('dist-copy', ['copy']);
|
||||
grunt.registerTask('dist-assets', ['svgmin', 'svgstore', 'string-replace']);
|
||||
grunt.registerTask('dist-styleguide', ['assemble:styleguide']);
|
||||
grunt.registerTask('dist', ['clean:dist', 'shell', 'dist-css', 'dist-js', 'dist-assets', 'dist-copy', 'dist-styleguide', 'manifest']);
|
||||
grunt.registerTask('dist-styleguide', ['sass:styleguide', 'autoprefixer:styleguide', 'csso:styleguide', 'assemble:styleguide']);
|
||||
// generate styleguide after manifest to forward version number to styleguide
|
||||
grunt.registerTask('dist', ['clean:dist', 'shell', 'dist-css', 'dist-js', 'dist-assets', 'dist-copy', 'manifest', 'dist-styleguide']);
|
||||
|
||||
// Test/Dev tasks
|
||||
grunt.registerTask('dev', ['connect:dev']);
|
||||
|
18
src/sass/styleguide.scss
Executable file
18
src/sass/styleguide.scss
Executable file
@ -0,0 +1,18 @@
|
||||
// Third party libs
|
||||
@import "lib/scut";
|
||||
|
||||
// Config
|
||||
@import "base/config"; // Modify this for custom colors, font-sizes, etc
|
||||
|
||||
// Mixins
|
||||
@import "mixins/responsive";
|
||||
@import "mixins/scrollbar";
|
||||
|
||||
// Styleguide specific blocks
|
||||
// Namespaced with "sg-"
|
||||
// (BEM-like Naming, see http://cssguidelin.es/#bem-like-naming)
|
||||
|
||||
@import "styleguide/layout";
|
||||
@import "styleguide/typo";
|
||||
@import "styleguide/sections";
|
||||
@import "styleguide/icon-list";
|
20
src/sass/styleguide/_icon-list.scss
Normal file
20
src/sass/styleguide/_icon-list.scss
Normal file
@ -0,0 +1,20 @@
|
||||
.sg-icon-list {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
& > li {
|
||||
display: inline-block;
|
||||
padding: 0 10px;
|
||||
margin-bottom: 20px;
|
||||
text-align: center;
|
||||
color: $color-text-light;
|
||||
width: 10em;
|
||||
& > svg {
|
||||
display: block;
|
||||
margin: 0 auto 10px;
|
||||
width: 2em;
|
||||
height: 2em;
|
||||
fill: $color-text;
|
||||
}
|
||||
}
|
||||
}
|
82
src/sass/styleguide/_layout.scss
Normal file
82
src/sass/styleguide/_layout.scss
Normal file
@ -0,0 +1,82 @@
|
||||
// Styleguide layout
|
||||
|
||||
.sg-layout {
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
// allow scrolling on iOS
|
||||
-webkit-overflow-scrolling: touch;
|
||||
|
||||
&__canvas {
|
||||
min-height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: $color-bg;
|
||||
color: $color-text;
|
||||
}
|
||||
|
||||
&__header {
|
||||
padding: 50px 20px;
|
||||
background: $color-bg-dark;
|
||||
border-bottom: 1px solid darken($color-bg-dark, 10%);
|
||||
img {
|
||||
display: block;
|
||||
width: 100%;
|
||||
max-width: 300px;
|
||||
max-height: 4em;
|
||||
margin: 0 auto 10px;
|
||||
}
|
||||
}
|
||||
|
||||
&__main {
|
||||
flex-grow: 1;
|
||||
width: 100%;
|
||||
padding: 10px 20px;
|
||||
margin: 0 auto;
|
||||
max-width: 1150px;
|
||||
}
|
||||
|
||||
&__footer {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-size: $font-size-small;
|
||||
color: $color-text-light;
|
||||
line-height: 1.5;
|
||||
padding: 10px 20px;
|
||||
|
||||
nav {
|
||||
ul {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
li {
|
||||
display: inline;
|
||||
&:after {
|
||||
display: inline-block;
|
||||
content: ' | ';
|
||||
margin: 0 0.5em;
|
||||
}
|
||||
&:last-child:after {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
&:hover,
|
||||
&:focus {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@include respond-to(md) {
|
||||
text-align: left;
|
||||
nav {
|
||||
float: right;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
33
src/sass/styleguide/_sections.scss
Normal file
33
src/sass/styleguide/_sections.scss
Normal file
@ -0,0 +1,33 @@
|
||||
.sg-section {
|
||||
margin: 50px 0;
|
||||
}
|
||||
|
||||
.sg-block {
|
||||
margin: 20px 0;
|
||||
padding-top: 20px;
|
||||
border-top: 1px solid $color-border-light;
|
||||
|
||||
&:last-of-type {
|
||||
border-bottom: 1px solid $color-border-light;
|
||||
}
|
||||
|
||||
&__description {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
&__example {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
@include respond-to(lg) {
|
||||
@include scut-clearfix;
|
||||
|
||||
&__description {
|
||||
float: left;
|
||||
width: 25%;
|
||||
padding-right: 30px;
|
||||
}
|
||||
&__example {
|
||||
margin-left: 25%;
|
||||
}
|
||||
}
|
||||
}
|
42
src/sass/styleguide/_typo.scss
Normal file
42
src/sass/styleguide/_typo.scss
Normal file
@ -0,0 +1,42 @@
|
||||
// Styleguide typography
|
||||
|
||||
.sg-typo-title {
|
||||
text-transform: uppercase;
|
||||
font-weight: normal;
|
||||
text-align: center;
|
||||
font-size: $font-size-bigger;
|
||||
color: $color-main;
|
||||
margin: 0 0 20px;
|
||||
|
||||
@include respond-to(md) {
|
||||
font-size: $font-size-huge;
|
||||
}
|
||||
}
|
||||
|
||||
.sg-typo-section-title {
|
||||
font-size: $font-size-bigger;
|
||||
font-weight: normal;
|
||||
color: $color-text;
|
||||
margin: 0 0 20px;
|
||||
|
||||
@include respond-to(md) {
|
||||
font-size: $font-size-huge;
|
||||
}
|
||||
}
|
||||
|
||||
.sg-typo-description-title {
|
||||
font-size: $font-size-big;
|
||||
font-weight: bold;
|
||||
color: $color-text;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.sg-typo-code {
|
||||
font-family: monospace;
|
||||
font-weight: bold;
|
||||
border-radius: 0.2em;
|
||||
font-size: $font-size-small;
|
||||
background: $color-bg-dark;
|
||||
color: $color-text;
|
||||
padding: 0.1em 0.3em;
|
||||
}
|
@ -2,7 +2,25 @@
|
||||
title: Styleguide
|
||||
---
|
||||
|
||||
{{#compose src="src/img/icons/*.svg"}}
|
||||
<svg role="presentation"><use xlink:href="#icon-{{stripFileExtension @filename}}" /></svg>
|
||||
{{@filename}}
|
||||
{{/compose}}
|
||||
<section class="sg-section">
|
||||
<h2 class="sg-typo-section-title">Icons</h2>
|
||||
<div class="sg-block">
|
||||
<div class="sg-block__description">
|
||||
<h3 class="sg-typo-description-title">Available icons</h3>
|
||||
<p class="typo-paragraph">
|
||||
All icons are available via inline svg and the <code class="sg-typo-code">xlink:href</code>
|
||||
attribute of the <code class="sg-typo-code"><use></code> tag.
|
||||
</p>
|
||||
</div>
|
||||
<div class="sg-block__example">
|
||||
<ul class="sg-icon-list">
|
||||
{{#compose src="src/img/icons/[!all]*.svg"}}
|
||||
<li>
|
||||
<svg role="presentation"><use xlink:href="#icon-{{stripFileExtension @filename}}" /></svg>
|
||||
{{@filename}}
|
||||
</li>
|
||||
{{/compose}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
@ -1,3 +1,8 @@
|
||||
---
|
||||
version: foobar
|
||||
currentDate: <%= new Date() %>
|
||||
---
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
@ -5,6 +10,9 @@
|
||||
<title>{{ title }} | Whiteout Mail</title>
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
|
||||
<link rel="stylesheet" media="all" href="{{assets}}/css/all.min.css" type="text/css">
|
||||
<link rel="stylesheet" media="all" href="{{assets}}/styleguide/css/styleguide.min.css" type="text/css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@ -13,7 +21,27 @@
|
||||
{{glob "src/img/icons/all.svg"}}
|
||||
</div>
|
||||
|
||||
{{> body}}
|
||||
<div class="sg-layout">
|
||||
<header class="sg-layout__header">
|
||||
<img src="{{assets}}/img/whiteout_logo.svg" alt="whiteout.io">
|
||||
<h1 class="sg-typo-title">{{ title }}</h1>
|
||||
</header>
|
||||
<main class="sg-layout__main">
|
||||
{{> body}}
|
||||
</main>
|
||||
<footer class="sg-layout__footer">
|
||||
<nav>
|
||||
<ul>
|
||||
<li><a href="https://whiteout.io/imprint.html" target="_blank">Imprint</a></li>
|
||||
<li><a href="https://whiteout.io/privacy-service.html" target="_blank">Privacy</a></li>
|
||||
<li><a href="https://whiteout.io/terms.html" target="_blank">Terms</a></li>
|
||||
<li><a href="https://github.com/whiteout-io/mail-html5/blob/master/README.md#license" target="_blank">License</a></li>
|
||||
<li>Version: {{manifest.version}}</li>
|
||||
</ul>
|
||||
</nav>
|
||||
© {{formatDate currentDate "%Y"}} Whiteout Networks GmbH
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user