Skip to content
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

Support for half stars #26

Closed
hkhuu1011 opened this issue Dec 21, 2017 · 6 comments
Closed

Support for half stars #26

hkhuu1011 opened this issue Dec 21, 2017 · 6 comments

Comments

@hkhuu1011
Copy link

Will half star ratings be supported in the near future?

@szynszyliszys
Copy link
Collaborator

Hi @hkhuu1011 ,
I don't think I am going to ship it as a part of library. You can see my answer to a sub-rating question some time ago: #9

@mislav
Copy link
Contributor

mislav commented Feb 20, 2018

Support for displaying half-star ratings via .starability-result might be useful for displaying average ratings. It's not necessary to make support for submitting half-star ratings, since that would be at the same time more complex to implement as well as harder to use.

screen shot 2018-02-20 at 4 25 12 pm

Here are the changes needed to make it happen:

@import "starability/starability-scss/starability/growRotate";

.starability-result {
  $star-count-result: $star-count - 1;
  @while $star-count-result > 0 {
    &[data-rating="#{$star-count-result}.5"]::after {
      width: $star-count-result * $star-size + $star-size / 2;
    }
    $star-count-result: $star-count-result - 1;
  }
}

@ciembor
Copy link

ciembor commented Mar 14, 2018

Yep, I need it as well. I must display an average of submitted results. It could be even more flexible / precise than just a half star. Thanks @mislav.

@szynszyliszys
Copy link
Collaborator

I am closing the Issue as the support won't be added in the library, but I pointed @mislav comment as a solution in the README.

@zacBkh
Copy link

zacBkh commented Jun 26, 2022

Hello!

Sorry, newbie here.
Where exactly can I put the code @mislav shared to make static display of floating number working ?

Thanks!

@szynszyliszys
Copy link
Collaborator

@zacBkh you can put it in your own CSS anywhere as long as it will come in your stylesheet after CSS from the library,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants