Timothy's Dev Stuff

A collection of code snippets and other developer things.

Diable Links with CSS

The code below can be used to disable pointer-events on a link. This was useful when a plugin generated links that could not be disabled in the settings, but we didn’t want those links. The CSS targeted the elements and prevented them from being clicked.

.disabled-link {
    pointer-events: none;
	color: var(--e-global-color-text) !important;
}

.disabled-link:hover {
    cursor: text;
}
That would work like so: This is an unclickable link.

And would look like this in the inspector:

<p>That would work like so: <a class="disabled-link" href="https://google.com">This is an unclickable link.</a></p>