-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
style: update overlay style on mobile #15760
Conversation
Run & review this pull request in StackBlitz Codeflow. |
packages/vite/src/client/overlay.ts
Outdated
.stack { | ||
white-space: pre-wrap; | ||
word-break: break-all; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this looks great. The stack trace paths can be long, and I think it's nicer if they're all within a single line and we can scroll it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this looks great. The stack trace paths can be long, and I think it's nicer if they're all within a single line and we can scroll it.
normally, scroll-x
in mobile modal is not good for developer or user , so I think that word-break
is necessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll let others chime in about this, but I think it's harder to read if the stack traces are line-wrapped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer a scrollbar, too. I think it's useful to have the function names lined up vertically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leaving my approval for the new width changes, but I'll still likely others thoughts on the stack trace line wrapping (#15760 (comment)). Here's the new screenshots for easier review:
ok , maybe we need more advices about that; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I totally agree with your change, however, I believe max-width
and padding
still should be static.
With large width monitor system, though it is pretty rare situation, using visual viewport metric lowers the experience.
I hope you can agree with me!
@@ -44,10 +44,11 @@ const template = /*html*/ ` | |||
.window { | |||
font-family: var(--monospace); | |||
line-height: 1.5; | |||
width: 800px; | |||
max-width: 80vw; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
max-width: 80vw; | |
width: 80vw; | |
max-width: 800px; |
How about doing max-width: 800px;
with width: 80vw;
?
I believe that max-width
should be a static value.
If we use max-width: 80vw;
, it would expand infinitely and I believe it looks bad.
This applies to padding
as well, however, I think we can use rem
instead of px
. What I found looked pretty good was padding: 1.5rem 2rem;
I am bringing up an extreme environment where screen width is 4000px
wide, but I think you will get the point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that I see here, I think it would be better to have the block margin of .window
to be dynamic to viewport height, i.e. margin: 10vh auto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the problem is that, the overlay
error info is not designed for Flexible screen, if U use big screen, the main problem maybe the font-size;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the problem is that, the overlay
error info is not designed for Flexible screen, if U use big screen, the main problem maybe the font-size;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get what you mean, but as we are introducing this change to support mobile viewport, we should consider the wider viewport as well.
If you think my opinion is unrelated to your PR, I will open another PR after this one being merged and continue the discussion! 😊
Description
make overlay style more flexible。
px
is not friendly inmobile
client。before
after
Additional context
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).