petalframework / petal_components

Phoenix + Live View HEEX Components
https://petal.build/components
MIT License
767 stars 84 forks source link

Rounds the width of the progress component to 2 decimal places #314

Closed trentjones21 closed 1 month ago

trentjones21 commented 3 months ago

This PR rounds the width of the progress component to 2 decimal places, as opposed to 0. 2 decimal places seemed like a reasonable precision to me, but I can adjust it if needed. It's rather arbitrary.

Examples:

<.progress value={50} max={100} />

<div class="pc-progress--md pc-progress pc-progress--primary ">
  <!-- BEFORE -->
  <span class="pc-progress__inner--primary pc-progress__inner" style="width: 50%">

  <!-- AFTER -->
  <span class="pc-progress__inner--primary pc-progress__inner" style="width: 50.0%">
</div>
<.progress value={2} max={3} />

<div class="pc-progress--md pc-progress pc-progress--primary ">
  <!-- BEFORE -->
  <span class="pc-progress__inner--primary pc-progress__inner" style="width: 67%">

  <!-- AFTER -->
  <span class="pc-progress__inner--primary pc-progress__inner" style="width: 66.67%">
</div>
nhobes commented 1 month ago

Sorry for the delay on this one and thanks for contributing, merged!