Hacker News new | past | comments | ask | show | jobs | submit login

Here is how they are calculating the actual axis refinement [0]

    const scoreWidth = (Astro.props.score - 33) * (100 / (100 - 33))
[0] https://github.com/withastro/astro.build/blob/main/src/pages...

> (Astro.props.score - 33) * (100 / (100 - 33))




The benefits of OSS marketing sites. You can make a PR/issue and point directly at their sneaky code.


Seems like someone has already done that: https://github.com/withastro/astro.build/pull/730


And its been merged now haha. You can see the change too on https://astro.build/

It's awesome just how quickly this got addressed.


Seems like now, predators due to some padding with the number text, the bar chart is still not proportional (but in the other direction. 98 should be further out)


This page barely scrolls on my i7 MBP and Firefox.


Happy to help


Have you checked it on mobile? Now it’s skewed the other way due to the space reserved for the label.


I'm aware, this was actually an issue prior to my PR as well, but less obvious. I think this would need some more defensive CSS to maybe shift the label around to the inside of the bar? Or perhaps the labels are unnecessary (it is a p90 of an average of a ton of lighthouse scores after all, not like the number quantifies to much)

Edit: https://github.com/withastro/astro.build/pull/731





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: