Skip to content

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
}
.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...

/* 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

);

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

@connorjclark connorjclark requested a review from paulirish April 14, 2022 23:13
@connorjclark connorjclark merged commit d8ec876 into master Apr 19, 2022
@connorjclark connorjclark deleted the el-screnshot-min-size branch April 19, 2022 18:34
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