-
Notifications
You must be signed in to change notification settings - Fork 127
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
lazy-sunshine
wants to merge
3
commits into
rugk:master
Choose a base branch
from
lazy-sunshine:Issue-12-incorrect-UI-display
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -133,6 +133,8 @@ a:active { | |
padding: 4px; | ||
|
||
border-radius: 4px; | ||
display: flex; | ||
|
||
|
||
/* use whole width */ | ||
width: calc(100% - 8px); | ||
|
@@ -171,6 +173,20 @@ a:active { | |
margin-top: 8px; | ||
} | ||
|
||
@media screen and (max-width: 767px) { | ||
.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); | ||
|
@@ -223,6 +239,8 @@ a:active { | |
margin: 4px; | ||
} | ||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove these empty lines you've added. 😄 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ping |
||
|
||
.error::before { | ||
background-image: url('/common/img/error-white.svg'); | ||
} | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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:
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…
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.
@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
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.
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)