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

[Rating] Individual icons and colors instead of fixed star+heart only #303

Merged
merged 2 commits into from
Dec 17, 2018

Conversation

lubber-de
Copy link
Member

Description

This PR provides the possibility to use any icon or color to be used in a rating instead of the previously hardcoded star or heart rating

Usage

The icon can be defined either as data-attribute data-icon

<div class="ui blue rating" data-icon="microphone"></div>

or as the JS parameter icon

$('.ui.rating')
    .rating({
        icon: 'woman'
    })
;   

The color can be provided as usual as a classname from the current color palette: ui green rating

Screenshot

individual_rating_icon

<div class="ui yellow rating" data-rating="2"></div>
<div class="ui red rating" data-icon="heart" data-rating="2"></div>
<div class="ui orange rating" data-icon="circle" data-rating="2"></div>
<div class="ui purple rating" data-icon="hotel" data-rating="2"></div>
<div class="ui green rating" data-icon="key" data-rating="2"></div>
<div class="ui blue rating" data-icon="man" data-rating="2"></div>
<div class="ui pink rating" data-icon="woman" data-rating="2"></div>

Closes

Semantic-Org/Semantic-UI#6710
Semantic-Org/Semantic-UI#2399

@lubber-de lubber-de added type/feat Any feature requests or improvements lang/css Anything involving CSS lang/javascript Anything involving JavaScript tag/new-component New UI components state/awaiting-reviews Pull requests which are waiting for reviews state/awaiting-docs Pull requests which need doc changes/additions tag/sui-issue Taken from an existing Issue/PR of SUI labels Dec 17, 2018
@lubber-de lubber-de added this to the 2.7.0 milestone Dec 17, 2018
@lubber-de lubber-de changed the title [Rating] Individual icons and colors instead of fixed star+rating only [Rating] Individual icons and colors instead of fixed star+heart only Dec 17, 2018
Copy link
Member

@y0hami y0hami left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@ColinFrick ColinFrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@y0hami y0hami merged commit 67f3b70 into fomantic:develop Dec 17, 2018
@y0hami y0hami removed state/awaiting-reviews Pull requests which are waiting for reviews labels Dec 17, 2018
@lubber-de lubber-de deleted the individual_rating_icon branch December 17, 2018 20:22
@lubber-de lubber-de added state/has-docs A issue/PR which requires documentation changes and has the corresponding PR open in the docs repo and removed state/awaiting-docs Pull requests which need doc changes/additions labels Dec 18, 2018
This was referenced Dec 21, 2018
@mrcasablr
Copy link

mrcasablr commented Dec 27, 2018

I'm the original reporter of the issue in semantic-ui project. I'm just thrilled beyond words on how quickly this was solved. I just wish semantic-ui-react changes to fomantic. I'm using sui-react and found out that this needed fixing in sui. I had no hope this would be addressed as the original issue was reported in 2016 in sui repo and you guys added this capability in 10 days! Amazing work!

@lubber-de @ColinFrick @hammy2899 Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang/css Anything involving CSS lang/javascript Anything involving JavaScript state/has-docs A issue/PR which requires documentation changes and has the corresponding PR open in the docs repo tag/new-component New UI components tag/sui-issue Taken from an existing Issue/PR of SUI type/feat Any feature requests or improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants