-
Notifications
You must be signed in to change notification settings - Fork 24
feat: New Prose component to style free-form HTML content consistently
#756
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
Conversation
src/prose/prose.module.css
Outdated
| .prose > :first-child, | ||
| .prose :global(.ProseMirror > *:first-child) { | ||
| margin-top: 0; | ||
| } | ||
|
|
||
| .prose > :last-child, | ||
| .prose :global(.ProseMirror > *:last-child) { | ||
| margin-bottom: 0; | ||
| } | ||
|
|
||
| .prose :global(br.ProseMirror-trailingBreak:only-child) { | ||
| font-size: inherit; | ||
| } |
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.
These hardcoded references to a ProseMirror class name is something I want to figure out next week, maybe with the help of Ricardo, how we can make this work seamlessly without Reactist having to have knowledge about it.
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.
Do you want to discuss this here or over Twist? Perhaps in a sync fashion? Either way is fine with me :)
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.
A sync video call should be helpful and allow us to move faster. I'll ping you on Twist to coordinate.
Bloomca
left a comment
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.
The component looks good and the API seems reasonable. I am going to be honest, I didn't notice the difference between light/dark mode typography, but that's expected with such slight tweaks.
c94d31f to
fe9965d
Compare
|
@gnapse I've only got back, so please excuse me if I'm missing context for this, but by having this |
fe9965d to
66a59db
Compare
I do not understand what's the concern exactly. Isn't the renderer going to generate HTML anyway? This is just syling the HTML in a standardized way. If you're concerned by anything non-standard that the renderer might output (e.g. a user mention) the corresponding draft PR in the Todoist web app shows how this can be dealt with in the app's code. Or let me know if the concern is about something else that I'm missing. |
66a59db to
50c2fb9
Compare
No, not really, it's just that to me, it feels strange to have the renderer component in one place (the apps), and the styling in another place (reactist). I feel like they should be coupled somehow. I guess my main concern is related to the user mention example you gave, because this |
|
I see no reason why the styling needs to be coupled to the markdown-to-html generator. And I don't see a reason for the higher-level prose styles to be concerned with app specifics. Otherwise, it'd need to be aware of anything new that a client app might decide to add that's custom. The client app will have to add some attributes to any custom thing, in order to style it differently. For instance, if the renderer outputs a mention, and that mention is a link ( The advantage of having the non-custom general stylings here is that we standardize how it's styled. The idea came from when the design team just requested that we leveraged the styles from Twist's markdown-generated content in Todoist. The alternative solution would've been to copy the styles from Twist's code to Todoist, but then, in the future, if these styles change, we need to change them twice. Anyway, I'm open for more discussion, and I may ask the question to the rest of the team to see what we collectively think. |
I don't have any compelling arguments either. At first, it felt like they belong together, but I agree with your reasoning that they probably shouldn't be coupled together. Feel free to open the discussion to the rest of the team if you think it's a discussion worth having, if not, just ignore what I said 😅 |
dd96fec to
931b120
Compare
4f8eb94 to
b2c3a82
Compare
Reference
Short description
A component to render free-form HTML and style it consistently. Mainly for rendering the markdown-generated content in our apps (both Twist and Todoist).
Test plan
I will thoroughly check first if this is easily adaptable to replace the markdown styles in Twist and Todoist before even merging it. I will also coordinate with designers to check the results in actual live examples.
Regardless of that, to the main PR reviewer, feel free to run storybooks and check things out.
PR Checklist
npm run validateand made sure no errors / warnings were shownCHANGELOG.mdpackage.jsonandpackage-lock.json(npm --no-git-tag-version version <major|minor|patch>) refnpm run build-all)Versioning
New minor release. Probably v20.1.0.