Ive been trying to see how I can change the cursor of jquery terminal when the page is not in focus. By default, it seems that when you click off the page making it unfocused, the cursor will dissappear. How can I make it so that it can just turn into an "empty box" like in most terminals? I took a look at the documentation found here: Documentation and I think I have to use the onBlur and onFocus functions to change it but im not sure how to use it.
Would some css similar to this help me achive it?:
.cmd:not(:focus) {
/* change the css of the cursor */
}
I tried taking a look at a few online articles about changing a css element when its not in focus, but I havent been able to find something that does what im asking. Im also not exactly sure how to change the Jquery terminal’s cursor specs like width, height, rotation, etc.
2
Answers
You can use
:focus-within
pseudo-class:With these selectors, you can customize the cursor using any CSS properties you want, such as
width, height, background-color
and so on.@Invulner is correct here is a working example:
NOTE: I wanted to edit his answer, but it felt weird.