DEV Community

cychu42
cychu42

Posted on

Dealign With A Magical Number: A Follow-Up PR

This one is going to be pretty short. To follow-up on a previous work where I handled some text overflow, I made a new PR to tackle the magic number I used for max width of an element. The goal was to at least make sure the number comes from somewhere reasonable. Because I can't use real percentage without messing up the UI in some way, I decided to "sort of do" it instead. I look up the closest parent element's and based the max width on the parent element's by a percentage. The parent element's max width was 510px, so I picked 60% of that, which is 306px.

This is my first follow-up PR, which introduce to me the idea of merging a PR and then follow it with related issues arise during the PR. Before, I would lean more toward fixing connected issue in the same PR, but one can just merge the PR if it covers the basci of the goals and then follow-up with more issues/PRs to tackle the rest.

I try to measure my growth by the complexity and volume of the code I work on, as well as whether I lean something new.
While this is simple, I at least learned something new.

Top comments (0)