Hacker News new | ask | show | jobs
by jonknee 5143 days ago
FWIW, Safari and Chrome both keep placeholder text there like this plug-in does (without the animation). It'd be nice to get FireFox on board.
2 comments

Yes, in -webkit- browsers you can achieve the same effect with this CSS:

        &::-webkit-input-placeholder {
            -webkit-transition: text-indent 200ms ease-in-out;
            visibility: visible !important;
        }

        &:focus::-webkit-input-placeholder {
            text-indent: 115px; /* Change to width of input */
        }
If only you could do the same for Firefox...
I had looked into doing this with pure CSS, but I hit a roadblock. I can't remember what it was, but it may have been the Firefox thing mentioned. Would be cool to add a css file that does the same to the project when the support is there though.