This repository has been archived on 2023-08-30. You can view files and clone it, but cannot push or open issues/pull-requests.
bytedo
/
wcui
Archived
1
0
Fork 0

更新打包配置;优化meditor样式

old
宇天 2018-08-05 19:23:14 +08:00
parent f1bcf9fad8
commit ce92b7ca4c
5 changed files with 28 additions and 20 deletions

View File

@ -4,12 +4,18 @@ const log = console.log
const fs = require('iofs') const fs = require('iofs')
const path = require('path') const path = require('path')
const scss = require('node-sass') const scss = require('node-sass')
const postcss = require('postcss')
const autoprefixer = require('autoprefixer')
const chalk = require('chalk') const chalk = require('chalk')
const uglify = require('uglify-es') const uglify = require('uglify-es')
const sourceDir = path.resolve(__dirname, 'src') const sourceDir = path.resolve(__dirname, 'src')
const buildDir = path.resolve(__dirname, 'dist') const buildDir = path.resolve(__dirname, 'dist')
const prefixer = postcss().use(
autoprefixer({
browsers: ['ff > 58', 'Chrome > 61']
})
)
const cssOpt = { const cssOpt = {
outputStyle: 'compressed' outputStyle: 'compressed'
@ -39,12 +45,14 @@ const compileCss = (entry, output) => {
let t1 = Date.now() let t1 = Date.now()
const { css } = scss.renderSync({ ...cssOpt, file: entry }) const { css } = scss.renderSync({ ...cssOpt, file: entry })
prefixer.process(css, { from: '', to: '' }).then(result => {
log( log(
'编译scss: %s, 耗时 %s ms', '编译scss: %s, 耗时 %s ms',
chalk.green(entry), chalk.green(entry),
chalk.yellow(Date.now() - t1) chalk.yellow(Date.now() - t1)
) )
fs.echo(css, output) fs.echo(result.css, output)
})
} }
/*=======================================================*/ /*=======================================================*/

View File

@ -27,7 +27,7 @@
h5:before, h5:before,
h6:before {display:block;position:absolute;left:0;top:50%;width:100%;content:" ";border-bottom:1px solid #ddd;} 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)} a:hover {color:nth($co, 2)}
p {margin:15px 0;} p {margin:15px 0;}
img {max-width:100%;} img {max-width:100%;}

File diff suppressed because one or more lines are too long

View File

@ -278,7 +278,7 @@ function showDialog(elem, vm, tool) {
menubar: false, menubar: false,
fixed: true, fixed: true,
maskClose: true, maskClose: true,
offset: [offset.top + 40 - $doc.scrollTop()], offset: [offset.top + 35 - $doc.scrollTop()],
shift: { shift: {
top: offset.top - $doc.scrollTop() top: offset.top - $doc.scrollTop()
}, },

View File

@ -39,7 +39,7 @@ const addon = {
this.close() this.close()
}, },
offset: [ offset: [
offset.top + 40 - $doc.scrollTop(), offset.top + 35 - $doc.scrollTop(),
'auto', 'auto',
'auto', 'auto',
offset.left - $doc.scrollLeft() offset.left - $doc.scrollLeft()
@ -130,7 +130,7 @@ const addon = {
this.close() this.close()
}, },
offset: [ offset: [
offset.top + 40 - $doc.scrollTop(), offset.top + 35 - $doc.scrollTop(),
'auto', 'auto',
'auto', 'auto',
offset.left - $doc.scrollLeft() offset.left - $doc.scrollLeft()
@ -228,7 +228,7 @@ const addon = {
'🙏' '🙏'
], ],
offset: [ offset: [
offset.top + 40 - $doc.scrollTop(), offset.top + 35 - $doc.scrollTop(),
'auto', 'auto',
'auto', 'auto',
offset.left - $doc.scrollLeft() offset.left - $doc.scrollLeft()
@ -259,7 +259,7 @@ const addon = {
maskClose: true, maskClose: true,
maskColor: 'rgba(255,255,255,0)', maskColor: 'rgba(255,255,255,0)',
offset: [ offset: [
offset.top + 40 - $doc.scrollTop(), offset.top + 35 - $doc.scrollTop(),
'auto', 'auto',
'auto', 'auto',
offset.left - $doc.scrollLeft() offset.left - $doc.scrollLeft()
@ -350,7 +350,7 @@ const addon = {
this.close() this.close()
}, },
offset: [ offset: [
offset.top + 40 - $doc.scrollTop(), offset.top + 35 - $doc.scrollTop(),
'auto', 'auto',
'auto', 'auto',
offset.left - $doc.scrollLeft() offset.left - $doc.scrollLeft()
@ -482,7 +482,7 @@ const addon = {
title: '关于编辑器', title: '关于编辑器',
maskClose: true, maskClose: true,
maskColor: 'rgba(255,255,255,0)', maskColor: 'rgba(255,255,255,0)',
offset: [offset.top + 37 - $doc.scrollTop()], offset: [offset.top + 35 - $doc.scrollTop()],
shift: { top: offset.top - $doc.scrollTop() }, shift: { top: offset.top - $doc.scrollTop() },
content: content:
'<div class="do-meditor-about">' + '<div class="do-meditor-about">' +