martywallace / vue-keyboard

A simple virtual keyboard for Vue.js.
MIT License
153 stars 16 forks source link

CSS class for certain button. #23

Closed kieranbarlow closed 6 years ago

kieranbarlow commented 6 years ago

I can see in the component the option to pass btn.type to the class property.

How do I pass this via the :layouts prop?

I'd like to set a class for a particular button.

martywallace commented 6 years ago

@Wolrab1 You can see here that I attach data-text and data-action attributes to every button, which you could use to target individual buttons with CSS with something like:

.vue-keyboard-key[data-text="b"] {
  color: red;
}

Which would style only the button containing the text b.