-
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
Updates to writing prompt block in full post reader #76092
Conversation
This PR does not affect the size of JS and CSS bundles shipped to the user's browser. Generated by performance advisor bot at iscalypsofastyet.com. |
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.
This looks much better! I left a couple of suggestions, otherwise looks good to go.
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 added a comment in the original reference (pctCYC-Mc-p2#comment-847) with some issues I found on the mobile app reader and I also added some comments about them here, for the ones I could identify the cause.
@thomashorta please have another look when you have a moment. I believe we should be close! |
@thomashorta I saw a comment come through from you via email, but I don't see it in the thread above for some reason. I removed the dark color scheme preference code in 8de7391 |
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.
Thanks for the changes, I think we are very close!!! I just added a comment about an issue regarding the usage of prefers-color-scheme
that I just realized.
} | ||
|
||
@media (prefers-color-scheme: dark) { | ||
.reader-full-post__story-content .jetpack-blogging-prompt .jetpack-blogging-prompt__label::before { |
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 believe this @media
query needs to be nested inside .jetpack-blogging-prompt__label
and this selector could be just &::before
.
Currently, the compiled css
is resulting in this matcher, because of the nesting:
.reader-full-post__story-content .jetpack-blogging-prompt .reader-full-post__story-content .jetpack-blogging-prompt .jetpack-blogging-prompt__label::before
Fixing the above makes things look good on mobile! 🎉
BUT doing so introduces a different problem that I just realized today. Since this CSS is also being used for web, this media
query will also apply on web browsers, which is not desirable, since even on a Dark theme, the Reader web page has a white background. Here's an example, injecting the resulting CSS on Chrome and switching between MacOS' Themes:
reader-media-prefer-color-scheme-browser-icon.mov
Sorry @davemart-in, GitHub is trolling me, I wrote that comment, and after I posted the page refreshed with your changes for today, so I deleted it in order to test it and make sure that was an actual problem, but it is. I am not sure what would be the best way of achieving the correct icon color on mobile without making hardcoded workarounds in both Android and iOS WebView "renderers". 😞 Maybe we should inject a |
I'm out of ideas as well. Happy to proceed however you think is best. We could: A) Just ship what I have in this PR and let you deal with the dark mode issue in each of the native implementations. Which do you prefer @thomashorta? |
I think we could ship with what you have in this PR for now, with the Btw, regarding that icon color on mobile, I was wondering if it would make sense to add the specific If that's possible and makes sense, adding the lines below to that file would make the block work 99% correctly on all clients, without any mobile-side changes. That missing 1% is a minor bug I found on Android that needs to be fixed in the app. @media (prefers-color-scheme: dark) {
.reader-full-post__story-content .jetpack-blogging-prompt .jetpack-blogging-prompt__label::before {
// stylelint-disable-next-line function-url-quotes
background-image: url("data:image/svg+xml,%3Csvg fill='none' height='20' viewBox='0 0 20 20' width='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m12.3438 17.3438h-4.68755c-.08594 0-.15625.0703-.15625.1562v.625c0 .3457.2793.625.625.625h3.75c.3457 0 .625-.2793.625-.625v-.625c0-.0859-.0703-.1562-.1562-.1562zm-2.3438-16.0938c-3.53711 0-6.40625 2.86914-6.40625 6.40625 0 2.37105 1.28906 4.44145 3.20313 5.54885v2.2637c0 .3457.27929.625.625.625h5.15622c.3457 0 .625-.2793.625-.625v-2.2637c1.9141-1.1074 3.2032-3.1778 3.2032-5.54885 0-3.53711-2.8692-6.40625-6.4063-6.40625zm2.498 10.7383-.7011.4062v2.293h-3.59377v-2.293l-.70118-.4062c-1.53711-.8887-2.50195-2.52541-2.50195-4.33205 0-2.76172 2.23828-5 5-5 2.7617 0 5 2.23828 5 5 0 1.80664-.9648 3.44335-2.502 4.33205z' fill='%23fff'/%3E%3C/svg%3E");
}
} What do you think? |
@thomashorta, yep! That is correct. Updated in 1806f5c |
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.
That is correct. Updated in 1806f5c
Awesome!!! Now it seems to be working correctly on Android, iOS, and Web! 🎉
Thanks a lot for the changes and sorry again for the back and forth! 🙇
Android | iOS |
---|---|
1806f5c
to
0c922a3
Compare
There were two seemingly unrelated E2E test failures, so I just rebased the branch to see if that would dismiss them. |
Description
It was brought to my attention yesterday that the new writing prompts block was being shown on the reader full post view without any formatting. This in turn is affecting the native mobile apps. There is an internal discussion related to the mobile apps here: pctCYC-Mc-p2
Before
After
Testing Instructions
/read/blogs/167232230/posts/5558