-
Notifications
You must be signed in to change notification settings - Fork 723
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
Use fontawesome icons #701
Comments
Hi @Akhanto! Check out this demo: CSS .ui-widget .ui-keyboard-bat,
.ui-widget .ui-keyboard-cat,
.ui-widget .ui-keyboard-ghost {
/* override jquery ui font setting */
font-family: "Font Awesome 5 Pro";
}
.ui-keyboard-bat span,
.ui-keyboard-cat span,
.ui-keyboard-ghost span {
display: none;
}
.ui-keyboard-bat:before {
content: '\f6b5';
}
.ui-keyboard-cat:before {
content: '\f6be';
}
.ui-keyboard-ghost:before {
content: '\f6e2';
} JS $(function() {
$("#keyboard").keyboard({
css: {
buttonDefault: "fas"
},
layout: "custom",
customLayout: {
default: ["bat cat ghost", "{accept} {cancel}"]
}
});
}); Including the |
Great, thank you! |
Oh, I forgot to mention that you can also include HTML in the $(function() {
// This is entered when the user pressed the {spider} key
$.keyboard.keyaction.spider = "x";
$("#keyboard").keyboard({
css: {
buttonDefault: "fas"
},
layout: "custom",
customLayout: {
default: ["bat cat ghost {spider}", "{accept} {cancel}"]
},
display: {
spider: '<i class="fas fa-spider"></i>'
}
});
}); |
Ha, perfect! In my case I only need it for action keys so it's no problem. |
Your example works great but when I try to realize stacked icons the script crashes. |
When a colon (
.ui-keyboard-button .fa-ban {
color: tomato;
} |
Thank you, that makes sense |
How can I use Font Awesome icons as keyboard keys?
I tried the unicode but without success. If I do so it doesn't show anything.
The text was updated successfully, but these errors were encountered: