Font-awesome: The icon-star-half should be a complete star with half filling

Created on 30 Jan 2013  路  5Comments  路  Source: FortAwesome/Font-Awesome

I really thing that icon-star-half should be a complete star so we could implement star rating with five icons of the same size. Please see attached images.

Greate work Dave.
star-half-full
big-four-half-star

Most helpful comment

This can be easily achieved with some code, no need for a half empty star.

.rating-box {
  position:relative;
  vertical-align: middle;
  font-size: 3/3em;
  font-family: FontAwesome;
  display:inline-block;
  color: lighten(@grayLight, 25%);

  &:before{
    content: "\f006 \f006 \f006 \f006 \f006";
  }

  .rating {
    position: absolute;
    left:0;
    top:0;
    white-space:nowrap;
    overflow:hidden;
    color: #F68127;
    &:before {
      content: "\f005 \f005 \f005 \f005 \f005";
    }
  }
}

HTML (just set the percentage):

<div class="rating-box">
    <div class="rating" style="width:70%;"></div>
</div>

Result:
Schermafbeelding 2013-02-11 om 11 56 14

All 5 comments

I think the above idea is great, but perhaps it should be added with a new name "icon-star-halfempty", & the existing "icon-star-half" should be left-aligned (eg as wide as a full star)? This will allow those who don't want to show empty stars.

+1

I have an app where I always display 5 stars for the rating scale and having a 1/2 full star would look much better than the current 1/2 star.

This can be easily achieved with some code, no need for a half empty star.

.rating-box {
  position:relative;
  vertical-align: middle;
  font-size: 3/3em;
  font-family: FontAwesome;
  display:inline-block;
  color: lighten(@grayLight, 25%);

  &:before{
    content: "\f006 \f006 \f006 \f006 \f006";
  }

  .rating {
    position: absolute;
    left:0;
    top:0;
    white-space:nowrap;
    overflow:hidden;
    color: #F68127;
    &:before {
      content: "\f005 \f005 \f005 \f005 \f005";
    }
  }
}

HTML (just set the percentage):

<div class="rating-box">
    <div class="rating" style="width:70%;"></div>
</div>

Result:
Schermafbeelding 2013-02-11 om 11 56 14

Cool! This works great. Thanks for the tip!

Dupe of #112

Was this page helpful?
0 / 5 - 0 ratings

Related issues

faithdong picture faithdong  路  3Comments

AndersDK12 picture AndersDK12  路  3Comments

Eschwinm picture Eschwinm  路  3Comments

ghost picture ghost  路  3Comments

sezeresen picture sezeresen  路  3Comments