Merge pull request #162 from chenjiahan/dev

fix: remove unnecessary supports in mobile browsers
This commit is contained in:
neverland 2017-09-29 04:37:30 -05:00 committed by GitHub
commit 841b50cd95
8 changed files with 88 additions and 546 deletions

View File

@ -3,36 +3,14 @@ import Vue from 'vue';
var exportObj = {};
if (!Vue.prototype.$isServer) {
var docStyle = document.documentElement.style;
var engine;
var translate3d = false;
if (window.opera && Object.prototype.toString.call(window.opera) === '[object Opera]') {
engine = 'presto';
} else if ('MozAppearance' in docStyle) {
engine = 'gecko';
} else if ('WebkitAppearance' in docStyle) {
engine = 'webkit';
} else if (typeof navigator.cpuClass === 'string') {
engine = 'trident';
}
var cssPrefix = { trident: '-ms-', gecko: '-moz-', webkit: '-webkit-', presto: '-o-' }[engine];
var vendorPrefix = { trident: 'ms', gecko: 'Moz', webkit: 'Webkit', presto: 'O' }[engine];
var helperElem = document.createElement('div');
var perspectiveProperty = vendorPrefix + 'Perspective';
var cssPrefix = '-webkit-';
var vendorPrefix = 'Webkit';
var transformProperty = vendorPrefix + 'Transform';
var transformStyleName = cssPrefix + 'transform';
var transitionProperty = vendorPrefix + 'Transition';
var transitionStyleName = cssPrefix + 'transition';
var transitionEndProperty = vendorPrefix.toLowerCase() + 'TransitionEnd';
if (helperElem.style[perspectiveProperty] !== undefined) {
translate3d = true;
}
var getTranslate = function(element) {
var result = { left: 0, top: 0 };
if (element === null || element.style === null) return result;
@ -65,12 +43,7 @@ if (!Vue.prototype.$isServer) {
}
cancelTranslateElement(element);
if (translate3d) {
element.style[transformProperty] += ' translate(' + (x ? (x + 'px') : '0px') + ',' + (y ? (y + 'px') : '0px') + ') translateZ(0px)';
} else {
element.style[transformProperty] += ' translate(' + (x ? (x + 'px') : '0px') + ',' + (y ? (y + 'px') : '0px') + ')';
}
};
var cancelTranslateElement = function(element) {

View File

@ -1,8 +1,8 @@
var gulp = require('gulp');
var postcss = require('gulp-postcss');
var cssmin = require('gulp-cssmin');
const gulp = require('gulp');
const postcss = require('gulp-postcss');
const cssmin = require('gulp-clean-css');
gulp.task('compile', function() {
gulp.task('compile', () => {
return gulp.src('./src/*.css')
.pipe(postcss())
.pipe(cssmin())

View File

@ -14,12 +14,11 @@
},
"license": "MIT",
"devDependencies": {
"autoprefixer": "^7.1.2",
"autoprefixer": "^7.1.4",
"gulp": "^3.9.1",
"gulp-cssmin": "^0.2.0",
"gulp-clean-css": "^3.9.0",
"gulp-postcss": "^7.0.0",
"postcss-easy-import": "^2.1.0",
"postcss-easy-import": "^3.0.0",
"precss": "^2.0.0"
},
"dependencies": {}
}
}

View File

@ -73,7 +73,6 @@ cat > $basepath/../src/icon.css <<EOF
/* Font smoothing. That was taken from TWBS */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
/* Uncomment for 3D effect */
/* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */

View File

@ -39,7 +39,6 @@
/* Font smoothing. That was taken from TWBS */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
/* Uncomment for 3D effect */
/* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */

View File

@ -67,5 +67,4 @@ textarea {
font-family: inherit;
margin: 0;
-webkit-appearance: none;
-moz-appearance: none;
}

View File

@ -86,7 +86,4 @@
-webkit-appearance: none;
margin: 0;
}
input[type=number] {
-moz-appearance: textfield;
}
}

File diff suppressed because it is too large Load Diff