Is there a way to change the CSS style value of an element when a specific keybind is pressed by the user?
<textarea id="check"
v-model="text"
v-on:keydown.ctrl.up="decreaseFont"
>
I am able to confirm that the decreaseFont function is being called, but the font-size value is not changing as expected.
decreaseFont() {
console.log("check")
document.getElementById("check").style.fontSize--;
}
Below is my CSS code snippet:
div textarea {
position: relative;
font-size: $fontSize;
color: white;
height: 100vh;
width: 100%;
outline: none;
border: none;
margin: 0;
padding: 0;
resize: none;
font-family: "Courier New", Courier, monospace;
}
In addition, I am trying to make the textview cover the entire screen without displaying a scrollbar. Even after setting the height to 100vh, the scrollbar still appears.
I have also set the margin and padding of the body element to 0 in order to troubleshoot this issue.