-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Reader: Make user profile header responsive #98184
Changes from 8 commits
3b92259
5ff3417
f401fc5
49bfc25
14f2339
c8a96fa
ec10617
02e7f1e
8596b12
a14b8fb
d5eb852
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 |
---|---|---|
@@ -1,31 +1,95 @@ | ||
@import '@wordpress/base-styles/mixins'; | ||
@import '@wordpress/base-styles/breakpoints'; | ||
|
||
.is-section-reader { | ||
.user-profile-header { | ||
max-width: 768px; | ||
margin: 0 auto; | ||
padding: 0 16px; | ||
|
||
&__main { | ||
align-items: center; | ||
display: flex; | ||
padding: 36px 0 24px; | ||
align-items: center; | ||
|
||
.reader-avatar { | ||
margin: 0 24px 0 0; | ||
@include breakpoint-deprecated( '<660px' ) { | ||
padding-top: 20px; | ||
} | ||
} | ||
|
||
&__avatar { | ||
margin-right: 24px; | ||
flex-shrink: 0; | ||
width: 116px; | ||
height: 116px; | ||
|
||
img { | ||
border-radius: 100%; | ||
width: 100%; | ||
height: 100%; | ||
} | ||
|
||
&-mobile { | ||
width: 72px; | ||
height: 72px; | ||
margin-right: 16px; | ||
display: block; | ||
|
||
@include break-mobile { | ||
display: none; | ||
} | ||
} | ||
|
||
&-desktop { | ||
display: none; | ||
|
||
@include break-mobile { | ||
display: block; | ||
margin-right: 24px; | ||
width: 116px; | ||
height: 116px; | ||
} | ||
} | ||
} | ||
|
||
&__details { | ||
flex: 1; | ||
min-width: 0; | ||
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. Do we need 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. It's helpful for really long text. For example, a long name will prevent the flexbox from shrinking past a certain width due to it sizing to the content, and then the bio will also run off the screen with the name. This prevents that. |
||
} | ||
|
||
&__display-name { | ||
font-family: Recoleta, sans-serif; | ||
font-size: 2rem; | ||
font-family: 'Noto Serif', Georgia, 'Times New Roman', Times, serif; | ||
font-size: $font-title-medium; | ||
font-weight: 600; | ||
line-height: 1.5; | ||
margin-bottom: 16px; | ||
display: flex; | ||
align-items: center; | ||
|
||
@include break-mobile { | ||
font-size: $font-title-large; | ||
margin-bottom: 8px; | ||
display: block; | ||
} | ||
|
||
&::after { | ||
@include long-content-fade( $size: 15% ); | ||
height: 16px * 1.7; | ||
top: auto; | ||
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. I think the I believe we're looking more for something along the following lines, right? To do that, we'd need to add 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. Oh, good find! I updated it, so now it's fading whatever flows out into the 16px padding of the header, and added nowrap to the name. 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. 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. Whoops! I added
I'm a bit torn on this. /read/feeds/{feedId} wraps the text, but I'm not sure I like the result. 😅 I'm leaning toward hiding the overflow because it keeps the layout behavior predictable, especially on small screens. We could try this on for size and follow up if it's not working for our users? I could also be convinced otherwise if you feel strongly about it. 😆 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. @artemiomorales, I'm going to go ahead and ship this PR since it's behind the flag. I'm happy to follow up on it in a new PR! 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.
Ok! The overflow sounds good to me. We can also iterate if need be :D |
||
} | ||
} | ||
|
||
&__bio { | ||
/* stylelint-disable-next-line scales/font-sizes */ | ||
font-size: 1.125rem; | ||
font-size: $font-body-large; | ||
color: var( --color-text-subtle ); | ||
|
||
@include break-mobile { | ||
font-size: $font-body; | ||
} | ||
} | ||
|
||
&__bio-desc { | ||
margin-bottom: 0; | ||
margin: 0; | ||
} | ||
|
||
.section-nav { | ||
|
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.
Should we use
@include break-small
or@include break-medium
here instead of using the deprecated mixin?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.
Ideally, yes. This breakpoint combats additional margin added here. There is no standard breakpoint for 660px, and rather than pull on the string to unravel the use of 660px here, I opted to use
breakpoint-deprecated( '<660px' )
.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.
If its possible to change both and not use deprecated one then maybe that's best. Otherwise this is fine too.
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'd like to land this PR using
breakpoint-deprecated( '<660px' )
. I'll timebox an investigation to see if we can refactor the deprecated breakpoint here, and open a separate PR to replace if it seems feasible.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 noting that this style would be better at
max-width: 781px
for the Lists component, as there's nobreakpoint-deprecated( '<660px' )
on that page that's when the sidebar collapses.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.
*We can handle this as part of a separate PR cleaning up styles for the Lists component.