Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

report: set minimum width of element screenshot preview #13856

Merged
merged 3 commits into from
Apr 19, 2022

Conversation

connorjclark
Copy link
Collaborator

@connorjclark connorjclark commented Apr 14, 2022

This makes really tall elements look less bad in the screenshot element preview by giving it a minimum width and centering. Also much easier to click on now.

The marker and mask elements were being positioned relative to the image... so it makes more sense to have the lh-element-screenshot__image element be the position: relative. This was necessary to make the outer content element center its contents correctly with a min-width / display flex / justify-content combo.


Before

image

image

After

image

image

@connorjclark connorjclark requested a review from a team as a code owner April 14, 2022 23:11
@connorjclark connorjclark requested review from adamraine and removed request for a team April 14, 2022 23:11
@connorjclark connorjclark changed the title report: give minimum size of element screenshot preview report: set minimum size of element screenshot preview Apr 14, 2022
@connorjclark connorjclark changed the title report: set minimum size of element screenshot preview report: set minimum width of element screenshot preview Apr 14, 2022
float: left;
margin-right: 20px;
}
.lh-element-screenshot__content {
overflow: hidden;
min-width: 110px;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm... might wanna do min height too...

@@ -1745,15 +1745,18 @@ details[open] .lh-clump-toggletext--hide { display: block;}

/* Element screenshot */
.lh-element-screenshot {
position: relative;
overflow: hidden;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these didn't seem to do anything

@@ -253,9 +253,6 @@ export class ElementScreenshotRenderer {
{width: screenshot.width, height: screenshot.height}
);

const contentEl = dom.find('div.lh-element-screenshot__content', containerEl);
contentEl.style.top = `-${elementPreviewSizeDC.height}px`;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this didn't seem to do anything

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants