Make CSS agnostic to underlying profile image size

Summary: Ref T7707. My analysis there was a bit confused and this isn't really all that important, but seems cleaner and desirable to be agnostic to the underlying image size.

Test Plan: Tested Safari, Firefox and Chrome with a variety of profile image sizes.

Reviewers: chad, btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T7707

Differential Revision: https://secure.phabricator.com/D12825
This commit is contained in:
epriestley
2015-05-13 08:14:47 -07:00
parent 47b14c9bde
commit b06b3d79b7
7 changed files with 30 additions and 12 deletions

View File

@@ -95,13 +95,22 @@ final class PhabricatorAuthAccountView extends AphrontView {
$image_uri = $image_file->getURIForTransform($xform); $image_uri = $image_file->getURIForTransform($xform);
list($x, $y) = $xform->getTransformedDimensions($image_file); list($x, $y) = $xform->getTransformedDimensions($image_file);
$profile_image = phutil_tag(
'div',
array(
'class' => 'auth-account-view-profile-image',
'style' => 'background-image: url('.$image_uri.');',
));
return phutil_tag( return phutil_tag(
'div', 'div',
array( array(
'class' => 'auth-account-view', 'class' => 'auth-account-view',
'style' => 'background-image: url('.$image_uri.');',
), ),
$content); array(
$profile_image,
$content,
));
} }
} }

View File

@@ -26,12 +26,21 @@
.auth-account-view { .auth-account-view {
background-color: #fff; background-color: #fff;
border: 1px solid {$lightblueborder}; border: 1px solid {$lightblueborder};
background-repeat: no-repeat;
background-position: 4px 4px;
background-size: 50px 50px;
padding: 4px 4px 4px 62px;
min-height: 50px;
border-radius: 2px; border-radius: 2px;
min-height: 50px;
position: relative;
padding: 4px 4px 4px 64px;
}
.auth-account-view-profile-image {
width: 50px;
height: 50px;
top: 4px;
left: 4px;
background-repeat: no-repeat;
background-size: 100%;
position: absolute;
} }
.auth-account-view-name { .auth-account-view-name {

View File

@@ -162,7 +162,7 @@
.conpherence-message-pane .conpherence-transaction-view { .conpherence-message-pane .conpherence-transaction-view {
padding: 2px 0px; padding: 2px 0px;
margin: 4px 12px; margin: 4px 12px;
background-size: 35px; background-size: 100%;
min-height: auto; min-height: auto;
} }

View File

@@ -26,7 +26,7 @@
position: absolute; position: absolute;
width: 30px; width: 30px;
height: 30px; height: 30px;
background-size: 30px; background-size: 100%;
} }
.phabricator-notification .conpherence-menu-item-view .phabricator-notification .conpherence-menu-item-view

View File

@@ -90,7 +90,7 @@ body.device-phone .phui-header-view {
.phui-header-image { .phui-header-image {
display: inline-block; display: inline-block;
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 50px; background-size: 100%;
border: 2px solid white; border: 2px solid white;
width: 50px; width: 50px;
height: 50px; height: 50px;

View File

@@ -599,7 +599,7 @@ ul.phui-object-item-icons {
.phui-object-item-image { .phui-object-item-image {
width: 40px; width: 40px;
height: 40px; height: 40px;
background-size: 40px; background-size: 100%;
margin: 6px; margin: 6px;
position: absolute; position: absolute;
background-color: {$lightbluebackground}; background-color: {$lightbluebackground};

View File

@@ -92,7 +92,7 @@
.phui-timeline-image { .phui-timeline-image {
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 50px; background-size: 100%;
position: absolute; position: absolute;
border-radius: 3px; border-radius: 3px;
} }