2
0
mirror of https://github.com/tenrok/vue-tribute.git synced 2026-06-24 18:00:37 +03:00

resetting proper styles on mirror el

This commit is contained in:
syropian
2016-07-24 23:07:04 -04:00
parent e357424fc6
commit e332de6f76
3 changed files with 12 additions and 10 deletions
+4 -4
View File
@@ -25,10 +25,11 @@ exports.install = function (Vue, options) {
var styles = window.getComputedStyle(_this.el, null); var styles = window.getComputedStyle(_this.el, null);
Object.assign(_this.mirror.style, { Object.assign(_this.mirror.style, {
position: "absolute", position: "absolute",
top: "0", top: "-9999px",
left: "0", left: "-9999px",
width: "auto", width: "auto",
whiteSpace: "nowrap", whiteSpace: "nowrap",
opacity: 0,
border: styles.getPropertyValue("border"), border: styles.getPropertyValue("border"),
fontSize: styles.getPropertyValue("font-size"), fontSize: styles.getPropertyValue("font-size"),
fontFamily: styles.getPropertyValue("font-family"), fontFamily: styles.getPropertyValue("font-family"),
@@ -36,8 +37,7 @@ exports.install = function (Vue, options) {
letterSpacing: styles.getPropertyValue("letter-spacing"), letterSpacing: styles.getPropertyValue("letter-spacing"),
padding: styles.getPropertyValue("padding"), padding: styles.getPropertyValue("padding"),
textTransform: styles.getPropertyValue("text-transform"), textTransform: styles.getPropertyValue("text-transform"),
ariaHidden: true, ariaHidden: true
opacity: 0
}); });
document.body.appendChild(_this.mirror); document.body.appendChild(_this.mirror);
_this.check(_this.el); _this.check(_this.el);
+4 -2
View File
@@ -33,13 +33,15 @@
left: "-9999px", left: "-9999px",
width: "auto", width: "auto",
whiteSpace: "nowrap", whiteSpace: "nowrap",
opacity: 0,
border: styles.getPropertyValue("border"),
fontSize: styles.getPropertyValue("font-size"), fontSize: styles.getPropertyValue("font-size"),
fontFamily: styles.getPropertyValue("font-family"), fontFamily: styles.getPropertyValue("font-family"),
fontWeight: styles.getPropertyValue("font-weight"), fontWeight: styles.getPropertyValue("font-weight"),
letterSpacing: styles.getPropertyValue("letter-spacing"), letterSpacing: styles.getPropertyValue("letter-spacing"),
padding: styles.getPropertyValue("padding"),
textTransform: styles.getPropertyValue("text-transform"), textTransform: styles.getPropertyValue("text-transform"),
ariaHidden: true, ariaHidden: true
opacity: 0
}); });
document.body.appendChild(_this.mirror); document.body.appendChild(_this.mirror);
_this.check(_this.el); _this.check(_this.el);
+4 -4
View File
@@ -24,10 +24,11 @@ exports.install = function(Vue, options){
let styles = window.getComputedStyle(this.el, null); let styles = window.getComputedStyle(this.el, null);
Object.assign(this.mirror.style, { Object.assign(this.mirror.style, {
position: "absolute", position: "absolute",
top: "0", top: "-9999px",
left: "0", left: "-9999px",
width: "auto", width: "auto",
whiteSpace: "nowrap", whiteSpace: "nowrap",
opacity: 0,
border: styles.getPropertyValue("border"), border: styles.getPropertyValue("border"),
fontSize: styles.getPropertyValue("font-size"), fontSize: styles.getPropertyValue("font-size"),
fontFamily: styles.getPropertyValue("font-family"), fontFamily: styles.getPropertyValue("font-family"),
@@ -35,8 +36,7 @@ exports.install = function(Vue, options){
letterSpacing: styles.getPropertyValue("letter-spacing"), letterSpacing: styles.getPropertyValue("letter-spacing"),
padding: styles.getPropertyValue("padding"), padding: styles.getPropertyValue("padding"),
textTransform: styles.getPropertyValue("text-transform"), textTransform: styles.getPropertyValue("text-transform"),
ariaHidden: true, ariaHidden: true
opacity: 0
}); });
document.body.appendChild(this.mirror); document.body.appendChild(this.mirror);
this.check(this.el); this.check(this.el);