diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b967e9..a03cd17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +### 1.6.13 +**2018-03-05** +* Fixed default avatar styles that did not carry over + ### 1.6.12 **2018-02-27** * Added new default avatar look to Quartz avatars diff --git a/VERSION b/VERSION index 9e7398a..d4ca915 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.6.12 +1.6.13 diff --git a/app/public/components.css b/app/public/components.css index 788abd3..078d46e 100644 --- a/app/public/components.css +++ b/app/public/components.css @@ -120,7 +120,12 @@ .avatar .default-avatar, .new-avatar .avatar-img, .new-avatar .default-avatar { - line-height: 36px; } + line-height: 36px; + font-size: 12px; } + .avatar .default-avatar, + .new-avatar .default-avatar { + padding-left: 1px; + padding-top: 0px; } .avatar.color-blue, .new-avatar.color-blue { background-color: #0F4E7B; } @@ -167,7 +172,11 @@ .avatar.avatar--xsmall .default-avatar, .new-avatar.avatar--xsmall .avatar-img, .new-avatar.avatar--xsmall .default-avatar { - line-height: 24px; } + line-height: 24px; + font-size: 8px; } + .new-avatar.avatar.avatar--xsmall .default-avatar { + padding-left: 0px; + padding-top: 0px; } .avatar.avatar--small, .new-avatar.avatar--small { width: 36px; @@ -176,7 +185,11 @@ .avatar.avatar--small .default-avatar, .new-avatar.avatar--small .avatar-img, .new-avatar.avatar--small .default-avatar { - line-height: 36px; } + line-height: 36px; + font-size: 12px; } + .new-avatar.avatar--small .default-avatar { + padding-left: 1px; + padding-top: 0px; } .avatar.avatar--medium, .new-avatar.avatar--medium { width: 46px; @@ -185,7 +198,11 @@ .avatar.avatar--medium .default-avatar, .new-avatar.avatar--medium .avatar-img, .new-avatar.avatar--medium .default-avatar { - line-height: 46px; } + line-height: 46px; + font-size: 15px; } + .new-avatar.avatar--medium .default-avatar { + padding-left: 1px; + padding-top: 0px; } .avatar.avatar--large, .new-avatar.avatar--large { width: 60px; @@ -194,7 +211,11 @@ .avatar.avatar--large .default-avatar, .new-avatar.avatar--large .avatar-img, .new-avatar.avatar--large .default-avatar { - line-height: 60px; } + line-height: 60px; + font-size: 20px; } + .new-avatar.avatar--large .default-avatar { + padding-left: 2px; + padding-top: 1px; } .avatar.avatar--xlarge, .new-avatar.avatar--xlarge { width: 80px; @@ -203,7 +224,11 @@ .avatar.avatar--xlarge .default-avatar, .new-avatar.avatar--xlarge .avatar-img, .new-avatar.avatar--xlarge .default-avatar { - line-height: 80px; } + line-height: 80px; + font-size: 26px; } + .new-avatar.avatar--xlarge .default-avatar { + padding-left: 2px; + padding-top: 1px; } .avatar.avatar--xxlarge, .new-avatar.avatar--xxlarge { width: 100px; @@ -212,13 +237,17 @@ .avatar.avatar--xxlarge .default-avatar, .new-avatar.avatar--xxlarge .avatar-img, .new-avatar.avatar--xxlarge .default-avatar { - line-height: 100px; } - + line-height: 100px; + font-size: 33px; } + .new-avatar.avatar--xxlarge .default-avatar { + padding-left: 3px; + padding-top: 1px; } .new-avatar { text-align: center; } .new-avatar .default-avatar { color: #fff; - font-weight: bold; } + font-weight: bold; + display: block; } .avatar:before { color: red; diff --git a/app/public/quartz.js b/app/public/quartz.js index d52d0b7..dbdd5c1 100644 --- a/app/public/quartz.js +++ b/app/public/quartz.js @@ -240,13 +240,19 @@ vhxm.components.shared.autosuggest.ui.container = { }; vhxm.components.shared.avatar.ui = { view: function view(ctrl, opts) { - return m('span.new-avatar.color-teal.avatar--' + (opts.size ? opts.size : 'medium'), [m('span.default-avatar', opts.initial), m('span.avatar-user.user-avatar', { - style: { - backgroundImage: 'url(' + opts.image + ')' - } - })]); + return m('span.new-avatar.color-teal.avatar--' + (opts.size ? opts.size : 'medium'), [ + m('span.avatar-user.user-avatar', [ + m('span.default-avatar', opts.initial), + m('span.avatar-user.user-avatar', { + style: { + backgroundImage: 'url(' + opts.image + ')' + } + }) + ]) + ]); } -};vhxm.components.shared.checkbox.ui.container = { +}; +vhxm.components.shared.checkbox.ui.container = { view: function view(ctrl, opts) { return m('fieldset.checkbox.' + (opts.size ? opts.size : 'medium') + (opts.type === 'toggle' ? '.alt' : ''), [m('input[type=checkbox]', { checked: opts.checked, diff --git a/dist/component-avatar.css b/dist/component-avatar.css index 645a624..16df213 100644 --- a/dist/component-avatar.css +++ b/dist/component-avatar.css @@ -45,11 +45,14 @@ border-radius: 50%; overflow: hidden; z-index: 1; } - .avatar .avatar-img, .avatar .default-avatar, - .new-avatar .avatar-img, .new-avatar .default-avatar { - line-height: 36px; } + line-height: 36px; + font-size: 12px; } + .avatar .default-avatar, + .new-avatar .default-avatar { + padding-left: 1px; + padding-top: 0px; } .avatar.color-blue, .new-avatar.color-blue { background-color: #0F4E7B; } @@ -92,62 +95,81 @@ .new-avatar.avatar--xsmall { width: 24px; height: 24px; } - .avatar.avatar--xsmall .avatar-img, .avatar.avatar--xsmall .default-avatar, - .new-avatar.avatar--xsmall .avatar-img, .new-avatar.avatar--xsmall .default-avatar { - line-height: 24px; } + line-height: 24px; + font-size: 8px; } + .avatar.avatar--xsmall .default-avatar, + .new-avatar.avatar--xsmall .default-avatar { + padding-left: 0px; + padding-top: 0px; } .avatar.avatar--small, .new-avatar.avatar--small { width: 36px; height: 36px; } - .avatar.avatar--small .avatar-img, .avatar.avatar--small .default-avatar, - .new-avatar.avatar--small .avatar-img, .new-avatar.avatar--small .default-avatar { - line-height: 36px; } + line-height: 36px; + font-size: 12px; } + .avatar.avatar--small .default-avatar, + .new-avatar.avatar--small .default-avatar { + padding-left: 1px; + padding-top: 0px; } .avatar.avatar--medium, .new-avatar.avatar--medium { width: 46px; height: 46px; } - .avatar.avatar--medium .avatar-img, .avatar.avatar--medium .default-avatar, - .new-avatar.avatar--medium .avatar-img, .new-avatar.avatar--medium .default-avatar { - line-height: 46px; } + line-height: 46px; + font-size: 15px; } + .avatar.avatar--medium .default-avatar, + .new-avatar.avatar--medium .default-avatar { + padding-left: 1px; + padding-top: 0px; } .avatar.avatar--large, .new-avatar.avatar--large { width: 60px; height: 60px; } - .avatar.avatar--large .avatar-img, .avatar.avatar--large .default-avatar, - .new-avatar.avatar--large .avatar-img, .new-avatar.avatar--large .default-avatar { - line-height: 60px; } + line-height: 60px; + font-size: 20px; } + .avatar.avatar--large .default-avatar, + .new-avatar.avatar--large .default-avatar { + padding-left: 2px; + padding-top: 1px; } .avatar.avatar--xlarge, .new-avatar.avatar--xlarge { width: 80px; height: 80px; } - .avatar.avatar--xlarge .avatar-img, .avatar.avatar--xlarge .default-avatar, - .new-avatar.avatar--xlarge .avatar-img, .new-avatar.avatar--xlarge .default-avatar { - line-height: 80px; } + line-height: 80px; + font-size: 27px; } + .avatar.avatar--xlarge .default-avatar, + .new-avatar.avatar--xlarge .default-avatar { + padding-left: 2px; + padding-top: 1px; } .avatar.avatar--xxlarge, .new-avatar.avatar--xxlarge { width: 100px; height: 100px; } - .avatar.avatar--xxlarge .avatar-img, .avatar.avatar--xxlarge .default-avatar, - .new-avatar.avatar--xxlarge .avatar-img, .new-avatar.avatar--xxlarge .default-avatar { - line-height: 100px; } + line-height: 100px; + font-size: 33px; } + .avatar.avatar--xxlarge .default-avatar, + .new-avatar.avatar--xxlarge .default-avatar { + padding-left: 3px; + padding-top: 1px; } .new-avatar { text-align: center; } .new-avatar .default-avatar { color: #fff; - font-weight: bold; } + font-weight: bold; + display: block; } .avatar:before { color: red; diff --git a/dist/component-avatar.js b/dist/component-avatar.js index 4a5f56b..cb55906 100644 --- a/dist/component-avatar.js +++ b/dist/component-avatar.js @@ -2,10 +2,10 @@ vhxm.components.shared.avatar.ui = { view: function view(ctrl, opts) { - return m('span.new-avatar.color-teal.avatar--' + (opts.size ? opts.size : 'medium'), [m('span.default-avatar', opts.initial), m('span.avatar-user.user-avatar', { + return m('span.new-avatar.color-teal.avatar--' + (opts.size ? opts.size : 'medium'), [m('span.avatar-user.user-avatar', [m('span.default-avatar', opts.initial), m('span.avatar-user.user-avatar', { style: { backgroundImage: 'url(' + opts.image + ')' } - })]); + })])]); } }; diff --git a/package-lock.json b/package-lock.json index 236050f..2e7d8d1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@vhx/quartz", - "version": "1.6.11", + "version": "1.6.13", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -1569,14 +1569,6 @@ } } }, - "string_decoder": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "requires": { - "safe-buffer": "5.0.1" - } - }, "string-width": { "version": "1.0.2", "bundled": true, @@ -1587,6 +1579,14 @@ "strip-ansi": "3.0.1" } }, + "string_decoder": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "safe-buffer": "5.0.1" + } + }, "stringstream": { "version": "0.0.5", "bundled": true, @@ -3887,8 +3887,9 @@ "dev": true }, "jquery": { - "version": "https://registry.npmjs.org/jquery/-/jquery-3.2.1.tgz", - "integrity": "sha1-XE2d5lKvbNCncBVKYxu6ErAVx4c=" + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.3.1.tgz", + "integrity": "sha512-Ubldcmxp5np52/ENotGxlLe6aGMvmF4R8S6tZjsP6Knsaxd/xp3Zrh50cG93lR6nPXyUFwzN3ZSOQI0wRJNdGg==" }, "js-tokens": { "version": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", @@ -5691,14 +5692,6 @@ "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", "dev": true }, - "string_decoder": { - "version": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha1-D8Z9fBQYJd6UKC3VNr7GubzoYKs=", - "dev": true, - "requires": { - "safe-buffer": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz" - } - }, "string-length": { "version": "https://registry.npmjs.org/string-length/-/string-length-1.0.1.tgz", "integrity": "sha1-VpcPscOFWOnnC3KL894mmsRa36w=", @@ -5717,6 +5710,14 @@ "strip-ansi": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz" } }, + "string_decoder": { + "version": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha1-D8Z9fBQYJd6UKC3VNr7GubzoYKs=", + "dev": true, + "requires": { + "safe-buffer": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz" + } + }, "stringstream": { "version": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=", @@ -5921,10 +5922,11 @@ "integrity": "sha1-meSYFWaihhGN+yuBc1ffeZM3bRA=" }, "velocity-animate": { - "version": "https://registry.npmjs.org/velocity-animate/-/velocity-animate-1.2.3.tgz", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/velocity-animate/-/velocity-animate-1.2.3.tgz", "integrity": "sha1-+LfGb++c/VrPpgXN8K3KjjAttyg=", "requires": { - "jquery": "https://registry.npmjs.org/jquery/-/jquery-3.2.1.tgz" + "jquery": "3.3.1" } }, "which": { diff --git a/package.json b/package.json index f30572b..36cac8a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@vhx/quartz", - "version": "1.6.12", + "version": "1.6.13", "description": "VHX Style Guide and JS Components.", "homepage": "https://github.com/vhx/quartz", "author": "VHX", diff --git a/quartz-js/components/avatar/avatar.ui.js b/quartz-js/components/avatar/avatar.ui.js index 4c26be3..e20dec4 100644 --- a/quartz-js/components/avatar/avatar.ui.js +++ b/quartz-js/components/avatar/avatar.ui.js @@ -1,12 +1,14 @@ vhxm.components.shared.avatar.ui = { view: function(ctrl, opts) { return m('span.new-avatar.color-teal.avatar--' + (opts.size ? opts.size : 'medium' ), [ - m('span.default-avatar', opts.initial), - m('span.avatar-user.user-avatar', { - style: { - backgroundImage: 'url(' + opts.image + ')' - } - }) + m('span.avatar-user.user-avatar', [ + m('span.default-avatar', opts.initial), + m('span.avatar-user.user-avatar', { + style: { + backgroundImage: 'url(' + opts.image + ')' + } + }) + ]) ]); } }; \ No newline at end of file diff --git a/quartz-js/components/avatar/styles/avatar.scss b/quartz-js/components/avatar/styles/avatar.scss index 1e84b6c..f07d475 100644 --- a/quartz-js/components/avatar/styles/avatar.scss +++ b/quartz-js/components/avatar/styles/avatar.scss @@ -5,9 +5,13 @@ @mixin avatar-defaults($diameter) { width: $diameter; height: $diameter; - .avatar-img, .default-avatar { line-height: $diameter; + font-size: round($diameter / 3); + } + .default-avatar { + padding-left: floor($diameter / 30); + padding-top: floor($diameter / 60); } } $avatar-colors-name: "blue", "purple", "pink", "orange", "green", "forest", "light-blue", "gray", "teal"; @@ -73,6 +77,7 @@ $avatar-colors-hex: $vhx-blue, $vhx-purple, lighten($red, 50%), $vhx-orange, lig .default-avatar { color: $white; font-weight: bold; + display: block; } }