-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Polish permalink UI and make it responsive #9010
Changes from 5 commits
481026c
63a23a7
d069ac5
bab5c54
ab3c628
f5c3696
f0e3b9d
4c35997
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,7 +49,7 @@ class PostPermalinkEditor extends Component { | |
className="editor-post-permalink-editor" | ||
onSubmit={ this.onSavePermalink } | ||
> | ||
<span> | ||
<span className="editor-post-permalink-editor__container"> | ||
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. It's close, but this is not quite following the naming standards. Specifically, the part preceding the 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. Looking again at those standards, we need to update them to be less... editor-specific. 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. Addressed feedback for now, perhaps we can revisit the editor naming separately? |
||
<span className="editor-post-permalink-editor__prefix"> | ||
{ prefix } | ||
</span> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,9 +55,29 @@ | |
display: inline-flex; | ||
align-items: center; | ||
|
||
.editor-post-permalink-editor__container { | ||
flex: 0 1 100%; | ||
display: flex; | ||
overflow: hidden; // This enables serious flex shrinking. | ||
padding: $border-width 0; // Necessary for the overflow to not crop the focus style. | ||
|
||
.editor-post-permalink-editor__prefix { | ||
flex: 1 1 auto; | ||
|
||
@include break-small { | ||
flex: 1 0 auto; | ||
} | ||
} | ||
|
||
.editor-post-permalink-editor__edit { | ||
flex: 1 1 100%; | ||
} | ||
} | ||
|
||
// Higher specificity required to override core margin styles. | ||
.editor-post-permalink-editor__save { | ||
margin-left: auto; | ||
flex: 0 1 auto; | ||
} | ||
} | ||
|
||
|
@@ -70,12 +90,17 @@ | |
text-overflow: ellipsis; | ||
} | ||
|
||
.editor-post-permalink-editor__edit { | ||
min-width: 20%; | ||
margin: 0 5px; | ||
.editor-post-permalink input[type="text"].editor-post-permalink-editor__edit { | ||
// Input fields are created with inherent widths. | ||
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. This was the cause of the failing test; fixing it now. |
||
// By supplying both a (any) width and a min-width, we allow it to scale in a flex container. | ||
min-width: 10%; | ||
width: 100%; | ||
margin: 0 3px; | ||
padding: 2px 4px; | ||
} | ||
|
||
.editor-post-permalink-editor__suffix { | ||
color: $dark-gray-300; | ||
margin-right: 10px; | ||
margin-right: 6px; | ||
flex: 0 0 0%; | ||
} |
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 quite sure what this comment means, and it references code aimed at a mobile viewport but talks about what happens outside the mobile viewport. I get that it means mobile behaves one way and others differently, but I think this comment could be clarified 😄
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.
Solid point, will rearrange and clarify that a bit.
THANKs for all the fixes and review!
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.
Addressed your comment in f5c3696