Coder Social home page Coder Social logo

Support for half stars about starability HOT 6 CLOSED

lunarlogic avatar lunarlogic commented on July 22, 2024
Support for half stars

from starability.

Comments (6)

mislav avatar mislav commented on July 22, 2024 1

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;
  }
}

from starability.

szynszyliszys avatar szynszyliszys commented on July 22, 2024

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

from starability.

ciembor avatar ciembor commented on July 22, 2024

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.

from starability.

szynszyliszys avatar szynszyliszys commented on July 22, 2024

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.

from starability.

zacBkh avatar zacBkh commented on July 22, 2024

Hello!

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

Thanks!

from starability.

szynszyliszys avatar szynszyliszys commented on July 22, 2024

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

from starability.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.