Profile picture of Michael GroßklausMichael Großklaus

RSS
Color scheme

Utility class for hiding elements visually

Hiding elements visually, but keeping them for screen readers:

.u-hiddenVisually {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  border: 0;
  padding: 0;
  white-space: nowrap;
  clip-path: inset(100%);
  clip: rect(0 0 0 0);
  overflow: hidden;
}

My by far most used utility class.