From 2107cf2a28b0261eacc5ddf8be0fa0894e55c42e Mon Sep 17 00:00:00 2001 From: Marcos Moura Date: Thu, 13 Oct 2016 04:29:09 -0300 Subject: [PATCH] Improve components --- build/webpack/base.js | 3 +-- build/webpack/prod-docs.js | 25 ++++++++++++++++++++++--- docs/src/components/code-block.vue | 4 ++-- docs/src/components/single-page.vue | 2 +- src/core/stylesheets/core.theme | 2 +- src/core/stylesheets/typography.scss | 13 +++++++++++-- 6 files changed, 38 insertions(+), 11 deletions(-) diff --git a/build/webpack/base.js b/build/webpack/base.js index 58ad78b..4fdafe7 100644 --- a/build/webpack/base.js +++ b/build/webpack/base.js @@ -4,14 +4,13 @@ import autoprefixer from 'autoprefixer'; import eslintFormatter from 'eslint-friendly-formatter'; import config from '../config'; - const buildAssetsPath = (_path) => { return path.posix.join(_path); }; export default { entry: { - 'docs/docs': './docs/src/index.js' + docs: './docs/src/index.js' }, output: { path: config.rootPath, diff --git a/build/webpack/prod-docs.js b/build/webpack/prod-docs.js index db38a5c..923da20 100644 --- a/build/webpack/prod-docs.js +++ b/build/webpack/prod-docs.js @@ -1,11 +1,18 @@ import webpack from 'webpack'; +import path from 'path'; import merge from 'webpack-merge'; import ExtractTextPlugin from 'extract-text-webpack-plugin'; import HtmlWebpackPlugin from 'html-webpack-plugin'; import config from '../config'; -import baseWebpackConfig from './base'; +import baseConfig from './base'; -export default merge(baseWebpackConfig, { + +export default merge(baseConfig, { + output: { + path: path.join(config.rootPath, 'docs'), + filename: '[name].[chunkhash:8].js', + chunkFilename: '[id].[chunkhash:8].js' + }, vue: { loaders: { css: ExtractTextPlugin.extract('css'), @@ -19,7 +26,7 @@ export default merge(baseWebpackConfig, { } }), new webpack.optimize.OccurenceOrderPlugin(), - new ExtractTextPlugin('[name].css'), + new ExtractTextPlugin('[name].[contenthash:8].css'), new HtmlWebpackPlugin({ filename: 'index.html', template: config.indexPath, @@ -42,6 +49,18 @@ export default merge(baseWebpackConfig, { useShortDoctype: true }, chunksSortMode: 'dependency' + }), + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks: (module) => { + let resource = module.resource; + + return resource && (/\.js$/).test(resource) && resource.indexOf(config.nodePath) === 0; + } + }), + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + chunks: ['vendor'] }) ] }); diff --git a/docs/src/components/code-block.vue b/docs/src/components/code-block.vue index 48ed232..a1f4009 100644 --- a/docs/src/components/code-block.vue +++ b/docs/src/components/code-block.vue @@ -10,12 +10,12 @@ .code-block { width: auto; max-width: 600px; - padding: 8px 32px; + padding: 4px 32px; margin: 0; position: relative; overflow: auto; border-radius: 2px; - background-color: #ededed; + background-color: #eee; color: #455A64; font-family: "Operator Mono", "Fira Code", Menlo, Hack, "Roboto Mono", "Liberation Mono", Monaco, monospace; font-size: 14px; diff --git a/docs/src/components/single-page.vue b/docs/src/components/single-page.vue index 942f78f..b8ae487 100644 --- a/docs/src/components/single-page.vue +++ b/docs/src/components/single-page.vue @@ -76,7 +76,7 @@ margin: 0; position: fixed; top: 12px; - left: 12px; + left: 8px; z-index: 3; color: #fff; } diff --git a/src/core/stylesheets/core.theme b/src/core/stylesheets/core.theme index 6f4521c..f4eb722 100644 --- a/src/core/stylesheets/core.theme +++ b/src/core/stylesheets/core.theme @@ -14,8 +14,8 @@ } body.THEME_NAME { - color: #{'BACKGROUND-CONTRAST-0.87'}; background-color: #{'BACKGROUND-COLOR-50'}; + color: #{'BACKGROUND-CONTRAST-0.87'}; } /* Typography */ diff --git a/src/core/stylesheets/typography.scss b/src/core/stylesheets/typography.scss index aaf6ee5..5cde0b7 100644 --- a/src/core/stylesheets/typography.scss +++ b/src/core/stylesheets/typography.scss @@ -1,4 +1,5 @@ -/* Text and Titles */ +/* Text and Titles + ========================================================================== */ .md-caption { font-size: 12px; @@ -70,8 +71,16 @@ line-height: 112px; } -/* Links */ + +/* Links & Buttons + ========================================================================== */ a { text-decoration: none; } + +button { + &:focus { + outline: none; + } +}