Skip to content

Améliorer la classe .offscreen

Bonjour,

Ayant eu un cas où la classe n'avait pas caché complètement un border à un élément, j'ai cherché comment on faisait de manière moderne et accessible.

Fichier à modifier : https://git.spip.net/spip/dist/src/branch/master/css/clear.css#L74

Méthodes : https://webaim.org/techniques/css/invisiblecontent/#techniques

Donc, il faudrait remplacer la méthode actuelle par :

.offscreen {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

ou plus moderne :

.offscreen {
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    width: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
}