mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
move hairline shim to bootstrap
This commit is contained in:
@ -148,7 +148,6 @@ function transpile(moduleType) {
|
||||
'ionic/**/*.ts',
|
||||
'ionic/**/*.js',
|
||||
'!ionic/components/*/test/**/*',
|
||||
'!ionic/util/hairline.js',
|
||||
'!ionic/util/test/*'
|
||||
])
|
||||
.pipe(cache('transpile', { optimizeMemory: true }))
|
||||
@ -177,8 +176,7 @@ gulp.task('transpile', ['transpile.system']);
|
||||
|
||||
gulp.task('bundle.ionic', ['transpile'], function() {
|
||||
return gulp.src([
|
||||
'dist/src/es5/system/ionic/**/*.js',
|
||||
'ionic/util/hairline.js'
|
||||
'dist/src/es5/system/ionic/**/*.js'
|
||||
])
|
||||
.pipe(concat('ionic.js'))
|
||||
.pipe(insert.append('System.config({ "paths": { "ionic/*": "ionic/*" } });'))
|
||||
|
@ -110,6 +110,22 @@ export class IonicApp {
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Hairline Shim
|
||||
* Add the "hairline" CSS class name to the body tag
|
||||
* if the browser supports subpixels.
|
||||
*/
|
||||
if (window.devicePixelRatio >= 2) {
|
||||
var hairlineEle = document.createElement('div');
|
||||
hairlineEle.style.border = '.5px solid transparent';
|
||||
document.body.appendChild(hairlineEle);
|
||||
|
||||
if (hairlineEle.offsetHeight === 1) {
|
||||
document.body.classList.add('hairlines');
|
||||
}
|
||||
document.body.removeChild(hairlineEle);
|
||||
}
|
||||
|
||||
bodyEle.setAttribute('mode', config.setting('mode'));
|
||||
}
|
||||
|
||||
|
@ -1,21 +0,0 @@
|
||||
|
||||
/**
|
||||
* Hairline Shim
|
||||
* Add the "hairline" CSS class name to the body tag
|
||||
* if the browser supports subpixels.
|
||||
*/
|
||||
|
||||
(function(document){
|
||||
|
||||
if (window.devicePixelRatio >= 2) {
|
||||
var hairlineEle = document.createElement('div');
|
||||
hairlineEle.style.border = '.5px solid transparent';
|
||||
document.body.appendChild(hairlineEle);
|
||||
|
||||
if (hairlineEle.offsetHeight === 1) {
|
||||
document.body.classList.add('hairlines');
|
||||
}
|
||||
document.body.removeChild(hairlineEle);
|
||||
}
|
||||
|
||||
})(document);
|
Reference in New Issue
Block a user