Skip to content

Commit

Permalink
fix cells没有title的时候缺乏margin-top
Browse files Browse the repository at this point in the history
  • Loading branch information
BearJ committed Oct 13, 2015
2 parents e4c9191 + 96e5d53 commit 4bd0b01
Show file tree
Hide file tree
Showing 10 changed files with 59 additions and 312 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ npm install -g gulp
npm install
gulp -ws
```
运行`gulp -ws`命令,会监听`src`目录下所有文件的变更,并且默认会在`8080`端口启动一个express服务器,然后在浏览器打开 `http://localhost:8080/example`
运行`gulp -ws`命令,会监听`src`目录下所有文件的变更,并且默认会在`8080`端口启动服务器,然后在浏览器打开 `http://localhost:8080/example`


## 手机预览
Expand Down
203 changes: 0 additions & 203 deletions dist/example/example.less

This file was deleted.

16 changes: 8 additions & 8 deletions dist/style/weui.css

Large diffs are not rendered by default.

70 changes: 42 additions & 28 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,54 +1,68 @@
var yargs = require('yargs').argv;
var gulp = require('gulp');
var chokidar = require('chokidar');
var less = require('gulp-less');
var minify = require('gulp-minify-css');
var autoprefixer = require('gulp-autoprefixer');
var rename = require('gulp-rename');

var express = require('express');
var sourcemaps = require('gulp-sourcemaps');
var browserSync = require('browser-sync');

var dist = __dirname + '/dist';

gulp.task('release', function(){

gulp.task('styles', function () {
var option = {base: 'src'};

gulp.src('src/example/**/**', option)
.pipe(gulp.dest(dist));
gulp.src('src/example/**/*.!(less)', option)
.pipe(gulp.dest(dist))
.pipe(browserSync.reload({stream: true}));

gulp.src('src/example/**/*.less', option)
.pipe(less())
.pipe(gulp.dest(dist));
gulp.src('src/example/example.less', option)
.pipe(less().on('error', function (e){
console.error(e.message);
this.emit('end');
}))
.pipe(gulp.dest(dist))
.pipe(browserSync.reload({stream: true}));

gulp.src('src/style/weui.less', option)
.pipe(less().on('error', function (e){
.pipe(sourcemaps.init())
.pipe(less().on('error', function (e) {
console.error(e.message);
this.emit('end');
}))
.pipe(sourcemaps.write())
.pipe(autoprefixer())
.pipe(gulp.dest(dist))
.pipe(minify())
.pipe(rename(function (path){
.pipe(rename(function (path) {
path.basename += '.min';
}))
.pipe(gulp.dest(dist));
.pipe(gulp.dest(dist))
.pipe(browserSync.reload({stream: true}));
});

gulp.task('release', ['styles']);

gulp.task('watch', function () {
chokidar.watch('src/**/*.*').on('all', function () {
gulp.run('release');
});
gulp.watch('src/**/*.less', ['styles']);
gulp.watch('src/example/**/*.{html,js}', function () {
browserSync.reload();
})
});

gulp.task('server', function () {
var app = express();
var port = yargs.p || yargs.port || 8080;
app.use(express.static(dist));
app.listen(port, function () {
port = port === 80 ? '' : ':' + port;
var url = 'http://127.0.0.1' + port;
console.log(url);
browserSync.init({
server: {
baseDir: "./dist"
},
ui: {
port: 8081,
weinre: {
port: 9090
}
},
port: 8080,
startPath: '/example'
});
});

Expand All @@ -58,13 +72,13 @@ gulp.task('server', function () {
// -s: 启动服务器
// -p: 服务器启动端口,默认8080
gulp.task('default', function () {
if (yargs.w){
if (yargs.s) {
gulp.start('server');
}
if (yargs.w) {
gulp.start('release');
gulp.start('watch');
}else{
} else {
gulp.start('release');
}
if (yargs.s){
gulp.start('server');
}
});
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
"author": "wechat ui team",
"license": "MIT",
"devDependencies": {
"chokidar": "^1.0.5",
"express": "^4.11.2",
"browser-sync": "^2.9.11",
"gulp": "^3.8.10",
"gulp-autoprefixer": "^2.3.1",
"gulp-less": "^3.0.2",
"gulp-minify-css": "^0.4.4",
"gulp-rename": "^1.2.2",
"gulp-replace": "^0.5.2",
"gulp-sourcemaps": "^1.6.0",
"yargs": "^1.3.3"
}
}
1 change: 1 addition & 0 deletions src/style/weui.less
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@import "./base/reset";



// icon font
@import "./icon/weui_icon_font";

Expand Down
2 changes: 1 addition & 1 deletion src/style/widget/weui_button/weui_btn_global.less
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
line-height: unit(@weuiBtnHeight/@weuiBtnFontSize);
border-radius: @weuiBtnBorderRadius;
.setTapColor();
overflow: visible;
overflow: hidden;
&:after {
content: " ";
width: 200%;
Expand Down
10 changes: 4 additions & 6 deletions src/style/widget/weui_button/weui_button.less
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,21 @@ button, input {
margin-right: 15px;
font-size: 0;
&.weui_btn_area_inline {
margin-left: auto;
margin-right: auto;
-webkit-display: flex;
display: flex;
//display: flex;
.weui_btn {
margin-top: auto;
margin-right: @weuiBtnDefaultGap;
width: 100%;
-webkit-flex: 1;
flex: 1;
&:last-child {
margin-right: 0;
}
//hack for IE9
display: inline-block ~"\9";
width: 48% ~"\9";
margin-left: 1% ~"\9";
margin-right: 1% ~"\9";
width: 48.5% ~"\9";
margin-right: 1.5% ~"\9";
}
}
}
Loading

0 comments on commit 4bd0b01

Please sign in to comment.