vpusher / game-card

playing game card element based on ES6 and Polymer 2.0
MIT License
41 stars 11 forks source link

Support highlighting/selecting a card #6

Closed Artur- closed 2 years ago

vpusher commented 7 years ago

@Artur- Thanks for your contribution. I am a bit embarrassed with your PR since selection means nothing in the only context of a <game-card>. It has to been handled by a component wrapping the<game-card>s, so you can bind the selection property. In my mind, the best approach is to provide some mixins so you can customize the card when events happen in your selection component. This would give some CSS like this one:

game-card.selected {
    --game-card-front-face: {
        background-color: rgba(255, 150, 150, 1);
    }
}

What about that ?