Skip to content
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

How to make cursor blinking on the focus input? #11

Closed
broodfusion opened this issue Oct 11, 2020 · 6 comments
Closed

How to make cursor blinking on the focus input? #11

broodfusion opened this issue Oct 11, 2020 · 6 comments

Comments

@broodfusion
Copy link

As title suggests, thanks

@andreaswilli
Copy link
Owner

Depends on what you mean by "blinking cursor":

  • If you mean a native cursor: This is not possible since the visible part of the component is not acutally an input element.
  • If you mean the selected field indicator: You can make it blink using a css animation like so:
.character--selected {
  animation: blink 1s infinite;
}

@keyframes blink {
  0% {
    outline: orange 3px solid;
  }
  50% {
    outline: orange 3px solid;
  }
  51% {
    outline: none;
  }
  100% {
    outline: none;
  }
}

@broodfusion
Copy link
Author

Thanks I've figured it out using a similar solution

@giopetris
Copy link

@broodfusion were you able to make this look like a real cursor?

@andreaswilli andreaswilli mentioned this issue Jan 11, 2023
@andreaswilli
Copy link
Owner

I added a complete example to the docs.

@billsbooth
Copy link

The example doesn't properly align the baseline of the character and the blinker...

Screenshot 2024-02-09 at 9 38 45 PM

@andreaswilli
Copy link
Owner

It's an example to use as a starting point.
Feel free to adapt the values, as they depend on the concrete typeface, etc.
That's also why this is not built into the library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants