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

Fix incorrect display of messages on multiple lines #226

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/common/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ a:active {
padding: 4px;

border-radius: 4px;
display: flex;


/* use whole width */
width: calc(100% - 8px);
Expand Down Expand Up @@ -171,6 +173,20 @@ a:active {
margin-top: 8px;
}

@media screen and (max-width: 767px) {
Copy link
Owner

Choose a reason for hiding this comment

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

Hmm, a fixed break point… Is this really good?

I mean, it should automatically wrap depending on the browser size, so we likely need something (more) responsive there, because:

  1. in other languages, there may be more text, so even for >767px the text may wrap
  2. for other screen sizes (widths) and other text contents this whole point, where it needs to break may change, too

Generally, consider that the same code here is embedded for all places where such messages could be appear. Also, I likely will adapt/move it to all other add-on's too, as they use the same code. (see TinyWebEx/common#6)
So this should work at all screen sizes and with any content, if possible…

Copy link
Author

Choose a reason for hiding this comment

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

@rugk I dnt think its possible that I can change element css based on its sibling element having multiline text,
but I can do a mobile first approach i.e with a min-width media query and if the button does nt fit in single line due to small size then I will move it to next line else for all other cases it could be singleline css only.
please suggest otherwise

Copy link
Owner

Choose a reason for hiding this comment

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

Hmm I also dunno the best way. You could try to have a look on how Firefox implements it on addons.mozilla.org e.g. (look for an unsupported old extension e.g., that should have a red error message).
Or in Firefox itself (about:debugging or about:addons may be good canidates if you e.g. trigger an error).
Or in the source code… I've did search it in a similar area before, so maybe near here you can find something.


If you don't find a better way, yeah, maybe the mobile-first idea is the best. (if I understood your idea correctly)

.message-box {
flex-wrap: wrap;
}
.message-text {
display: inline-block;
}

.message-box > a{
flex-basis: 100%;
margin: 8px 0 auto 18px;
}
}

.error {
color: var(--white-100);
background-color: var(--red-60);
Expand Down Expand Up @@ -223,6 +239,8 @@ a:active {
margin: 4px;
}


Copy link
Owner

Choose a reason for hiding this comment

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

Please remove these empty lines you've added. 😄

Copy link
Owner

Choose a reason for hiding this comment

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

ping


.error::before {
background-image: url('/common/img/error-white.svg');
}
Expand Down