...hi, this is av


ava's blog

my blinking cursor title code

I talked about wanting to change my blog design and just in case I'll remove the blinking cursor design from my title and for anyone that is interested, I thought I should share the code here.

Things to know:

Here is the relevant part.

        .lightmodeblink {
            --c: #444;
        }

        .darkmodeblink {
            --c: white;
        }

        @keyframes cursor-blink {
            50% {
                content: "a";
                color: var(--c);
                background: none;
            }

            100% {
                content: "a";
                color: white;
                background: darkgray;
            }
        }

        h2::after {
            content: "a";
            color: white;
            width: 20px;
            height: 35px;
            border-radius: 3px;
            background: darkgray;
            display: inline-block;
            animation: cursor-blink 1.0s steps(1) infinite;
}

You might have to adjust other CSS in your code.

#webdev