From ce92b7ca4ca6cc2baa765578fb21ac660c21f911 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Sun, 5 Aug 2018 19:23:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=89=93=E5=8C=85=E9=85=8D?= =?UTF-8?q?=E7=BD=AE;=E4=BC=98=E5=8C=96meditor=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.next.js | 22 +++++++++++++++------- src/css/marked.scss | 2 +- src/css/meditor.scss | 10 +++++----- src/meditor/addon/attach.js | 2 +- src/meditor/addon/base.js | 12 ++++++------ 5 files changed, 28 insertions(+), 20 deletions(-) diff --git a/build.next.js b/build.next.js index 9ef4b86..9e49e3f 100644 --- a/build.next.js +++ b/build.next.js @@ -4,12 +4,18 @@ const log = console.log const fs = require('iofs') const path = require('path') const scss = require('node-sass') - +const postcss = require('postcss') +const autoprefixer = require('autoprefixer') const chalk = require('chalk') const uglify = require('uglify-es') const sourceDir = path.resolve(__dirname, 'src') const buildDir = path.resolve(__dirname, 'dist') +const prefixer = postcss().use( + autoprefixer({ + browsers: ['ff > 58', 'Chrome > 61'] + }) +) const cssOpt = { outputStyle: 'compressed' @@ -39,12 +45,14 @@ const compileCss = (entry, output) => { let t1 = Date.now() const { css } = scss.renderSync({ ...cssOpt, file: entry }) - log( - '编译scss: %s, 耗时 %s ms', - chalk.green(entry), - chalk.yellow(Date.now() - t1) - ) - fs.echo(css, output) + prefixer.process(css, { from: '', to: '' }).then(result => { + log( + '编译scss: %s, 耗时 %s ms', + chalk.green(entry), + chalk.yellow(Date.now() - t1) + ) + fs.echo(result.css, output) + }) } /*=======================================================*/ diff --git a/src/css/marked.scss b/src/css/marked.scss index 53f8419..1a0d96c 100644 --- a/src/css/marked.scss +++ b/src/css/marked.scss @@ -27,7 +27,7 @@ h5:before, h6:before {display:block;position:absolute;left:0;top:50%;width:100%;content:" ";border-bottom:1px solid #ddd;} - a {text-decoration:underline;} + a {text-decoration:underline;color:nth($cgr, 1)} a:hover {color:nth($co, 2)} p {margin:15px 0;} img {max-width:100%;} diff --git a/src/css/meditor.scss b/src/css/meditor.scss index 7f0dcc7..356fb2b 100644 --- a/src/css/meditor.scss +++ b/src/css/meditor.scss @@ -12,7 +12,7 @@ src: url('data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAABEUAAsAAAAAGygAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADMAAABCsP6z7U9TLzIAAAE8AAAARAAAAFZW7kiCY21hcAAAAYAAAAELAAADBGqGdy9nbHlmAAACjAAAC8AAABIsPd75f2hlYWQAAA5MAAAALwAAADYRZEeYaGhlYQAADnwAAAAcAAAAJAfeA51obXR4AAAOmAAAABQAAABwb+kAAGxvY2EAAA6sAAAAOgAAADpDyD8EbWF4cAAADugAAAAfAAAAIAE0AG5uYW1lAAAPCAAAAUUAAAJtPlT+fXBvc3QAABBQAAAAwwAAAQaYIDHPeJxjYGRgYOBikGPQYWB0cfMJYeBgYGGAAJAMY05meiJQDMoDyrGAaQ4gZoOIAgCKIwNPAHicY2Bk/s84gYGVgYOpk+kMAwNDP4RmfM1gxMjBwMDEwMrMgBUEpLmmMDgwVDybyNzwv4EhhrmBoQEozAiSAwAwZA0EeJzFkllOAkEURU9B206I88gW/DSuxJ0goXHAeSKQwDb8clV3G3irH4lxBbzO6eRVakqdC6wATXNuCkg/JHJ9ezTV40026vGCofs2azQoqdRTXyNNNJvPPV6p636gsaZ1/1fJa9rs+bvgsu4b3rPwySWr3m3d+2/SYsuzttlh1zP3OeCQI4454ZQzOl5WsrRKyzv6f7XyL10tOr8K1QJfUd3A74uug+xWvSD7VT/I3jUI7AHdBDaCbgO7QXeBLaH7IOdBw8Dm0EOQb6fHwDbRU2Cv6DmwYfQS2DV6DWwdvQX2j94DJwF9BM4E+gycDvQVOCdoFDgxaBw4O2gSOEVo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WNPANzgBx6O3y33kT1cMjtyDRe4F65TfxBukF+Em2jjVbhF/U3YxzOmwm10YXmD17hi9oR3YQ8dfAjXcI1P4Tr1L+EG+Vu4iTv8CrfQ8erCPuZeV7iNRy/2x1YvnF6p5UHFockikzm/gple75KFrdLqnGtbxCZTg6BfSVOdaVvdU+zXQ+ciFVmTqgmrOkmMyq3Z6tAFG+fyUa8XiR6EJuVYY/62xgKOcQWFJQ6MMUIYZIjK6Og7VWb0r7FDwl57Vj3N53RbFNT/c4UBAvTPXFO6stJ5Ok+BPV8bUnV0K27LnpQ0kV7NSRKyQl7WtlRC6gE2ZVeOEXpc0Yk/KGdI/wAJWm7IAAAAeJxtjElSwzAUBfUUOY4VxjCEIRwhizDdR5a/S6r8SEKRgeODzZZedHW9xRNS/KHF/2wgMYNChTlqLNBAY4kTnOIM57jAJVa4wjVucIs17nCPBzxigyeB77kpxVinfOhj03K0exs7Ur2x1PQxlG0buVtM1RHrfmA+2kwUltPmi2FvpXuWbifdq3Rv0r0oR5yke9c+sA80HY4xav+rY9Exd5S3Y9bJ2zJkUsknqlOmT09f1ccQC1XFtEyq+AMJ8QPRDzuOAA==') format('woff'); } -.do-meditor {position:relative;display:block;width:100%;height:100%;padding-top:41px;border:1px solid nth($cp, 3);background:#fff;color:nth($cgr, 3); +.do-meditor {position:relative;display:block;width:100%;height:100%;padding-top:36px;border:1px solid nth($cp, 3);background:#fff;color:nth($cgr, 3); ::-webkit-scrollbar {width:5px;height:5px;background:nth($cp, 1);} ::-webkit-scrollbar:hover {background:nth($cp, 2);} @@ -25,12 +25,12 @@ &::after {position:absolute;left:0;top:0;z-index:100;width:100%;height:100%;content:"";background:rgba(255, 182, 24, 0.07);} } - .tool-bar {overflow:hidden;position:absolute;top:0;left:0;z-index:99;width:100%;height:41px;line-height:40px;border-bottom:1px solid nth($cp, 2);background:#fff;color:nth($cd, 2);text-align:center;font-size:24px; + .tool-bar {overflow:hidden;position:absolute;top:0;left:0;z-index:99;width:100%;height:36px;line-height:35px;border-bottom:1px solid nth($cp, 2);background:#fff;color:nth($cd, 2);text-align:center;font-size:24px; - span {float:left;width:40px;height:40px; + span {float:left;width:35px;height:35px; &:hover,&.active {background:#f7f8fb;} - &.icon-pipe {width:28px;background:#fff;color:nth($cp, 3);} + &.icon-pipe {width:14px;background:#fff;color:nth($cp, 3);text-indent:-6px;} } } @@ -46,7 +46,7 @@ &.preview .editor-body {width:50%} } -.do-meditor__font {font-family:"PingFang SC","Helvetica Neue","Hiragino Sans GB","Segoe UI","Microsoft YaHei",sans-serif;} + .do-meditor__icon {display:inline-block;font-family:"mefont" !important;font-style:normal;-webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale; &.icon-attach:before { content: "\e673"; } diff --git a/src/meditor/addon/attach.js b/src/meditor/addon/attach.js index 9996d1b..a075b92 100644 --- a/src/meditor/addon/attach.js +++ b/src/meditor/addon/attach.js @@ -278,7 +278,7 @@ function showDialog(elem, vm, tool) { menubar: false, fixed: true, maskClose: true, - offset: [offset.top + 40 - $doc.scrollTop()], + offset: [offset.top + 35 - $doc.scrollTop()], shift: { top: offset.top - $doc.scrollTop() }, diff --git a/src/meditor/addon/base.js b/src/meditor/addon/base.js index 8700f7e..b1c97ac 100644 --- a/src/meditor/addon/base.js +++ b/src/meditor/addon/base.js @@ -39,7 +39,7 @@ const addon = { this.close() }, offset: [ - offset.top + 40 - $doc.scrollTop(), + offset.top + 35 - $doc.scrollTop(), 'auto', 'auto', offset.left - $doc.scrollLeft() @@ -130,7 +130,7 @@ const addon = { this.close() }, offset: [ - offset.top + 40 - $doc.scrollTop(), + offset.top + 35 - $doc.scrollTop(), 'auto', 'auto', offset.left - $doc.scrollLeft() @@ -228,7 +228,7 @@ const addon = { '🙏' ], offset: [ - offset.top + 40 - $doc.scrollTop(), + offset.top + 35 - $doc.scrollTop(), 'auto', 'auto', offset.left - $doc.scrollLeft() @@ -259,7 +259,7 @@ const addon = { maskClose: true, maskColor: 'rgba(255,255,255,0)', offset: [ - offset.top + 40 - $doc.scrollTop(), + offset.top + 35 - $doc.scrollTop(), 'auto', 'auto', offset.left - $doc.scrollLeft() @@ -350,7 +350,7 @@ const addon = { this.close() }, offset: [ - offset.top + 40 - $doc.scrollTop(), + offset.top + 35 - $doc.scrollTop(), 'auto', 'auto', offset.left - $doc.scrollLeft() @@ -482,7 +482,7 @@ const addon = { title: '关于编辑器', maskClose: true, maskColor: 'rgba(255,255,255,0)', - offset: [offset.top + 37 - $doc.scrollTop()], + offset: [offset.top + 35 - $doc.scrollTop()], shift: { top: offset.top - $doc.scrollTop() }, content: '
' +