From fa6580e7a9ad0632b35ac766f434fa3f7312a412 Mon Sep 17 00:00:00 2001 From: wayne Date: Thu, 28 Sep 2017 20:15:00 +0800 Subject: [PATCH] Carbon: sidenav & table & changelog --- build/bin/template.js | 16 ++++ examples/app.vue | 2 +- examples/components/side-nav.vue | 52 ++++-------- examples/nav.config.json | 16 ++-- examples/pages/template/changelog.tpl | 113 +++++++++++++------------- examples/pages/template/component.tpl | 29 ++++--- package.json | 3 +- yarn.lock | 15 ++++ 8 files changed, 136 insertions(+), 110 deletions(-) create mode 100644 build/bin/template.js diff --git a/build/bin/template.js b/build/bin/template.js new file mode 100644 index 000000000..0cd2fe164 --- /dev/null +++ b/build/bin/template.js @@ -0,0 +1,16 @@ +const path = require('path'); +const templates = path.resolve(process.cwd(), './examples/pages/template'); + +const chokidar = require('chokidar'); +let watcher = chokidar.watch([templates]); + +watcher.on('ready', function() { + watcher + .on('change', function() { + exec('npm run i18n'); + }); +}); + +function exec(cmd) { + return require('child_process').execSync(cmd).toString().trim(); +} diff --git a/examples/app.vue b/examples/app.vue index 5564b70f8..331068574 100644 --- a/examples/app.vue +++ b/examples/app.vue @@ -21,7 +21,7 @@ } a { - color: #4078c0; + color: #1989FA; text-decoration: none; } diff --git a/examples/components/side-nav.vue b/examples/components/side-nav.vue index 11a9f4b51..8abb0c3b2 100644 --- a/examples/components/side-nav.vue +++ b/examples/components/side-nav.vue @@ -7,6 +7,7 @@ li { list-style: none; } + ul { padding: 0; margin: 0; @@ -36,7 +37,7 @@ } @when active { span, i { - color: #20a0ff; + color: #1989FA; } i { transform: rotateZ(180deg) translateY(2px); @@ -44,7 +45,7 @@ } &:hover { span, i { - color: #20a0ff; + color: #1989FA; } } } @@ -52,7 +53,7 @@ .nav-item { a { font-size: 16px; - color: #5e6d82; + color: #333; line-height: 40px; height: 40px; margin: 0; @@ -60,36 +61,39 @@ text-decoration: none; display: block; position: relative; - transition: all .3s; + transition: .15s ease-out; + font-weight: bold; &.active { - color: #20a0ff; + color: #1989FA; } } + .nav-item { a { display: block; height: 40px; + color: #666; line-height: 40px; - font-size: 13px; - padding-left: 24px; + font-size: 14px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; + font-weight: normal; - - &:hover { - color: #20a0ff; + &:hover, + &.active { + color: #1989FA; } } } } + .nav-group__title { font-size: 12px; - color: #99a9bf; - padding-left: 8px; + color: #999; line-height: 26px; - margin-top: 10px; + margin-top: 15px; } } .nav-dropdown-list { @@ -102,28 +106,6 @@