Skip to content

🩺 Check elements by KABA

Details

AuthorKABA

LicenseNo License

Categoryglobal styles

Created

Updated

Size1.0 kB

Statistics

Learn how we calculate statistics in the FAQ.

Failed to fetch stats.

Description

Check styles for Accessibility etc.

Notes

Userstyle doesn't have notes.

Source code

/* ==UserStyle==
@name         🩺 Check elements
@version      20240116.05.40
@namespace    ?
==/UserStyle== */

@-moz-document regexp(".*") {
    :root {
        --warn-color: #f439;
        --info-color: #29f9;
    }

    /* Lazy loading image */
    img {
        outline: 10px solid var(--c, var(--warn-color));
        outline-offset: 8px;

        &[loading=lazy] { --c: var(--info-color) }
    }

    a {
        /* Anchor requires href attribute */
        &:not([href]) {
            &::after {
                position: absolute;
                margin: .25em;
                background: #fffc;
                color: var(--warn-color);
                font-size: small;
                content: "Anchor doesn't have `href`";
            }
        }

        /* (in Anchor) Image requires alt if only image */
        img {
            &[alt=""],
            &:not([alt]) {
                box-shadow: 0 0 0 26px var(--warn-color);
            }
        }
    }
}

Reviews

No reviews yet.