Skip to content

Replace clip with clip-path property #27177

@RibbtDev

Description

@RibbtDev

Hi team,

The .sr-only and .sr-only-focusable classes need to be updated to use clip-path property instead of the old deprecated clip property.

According to MDN web docs, the CSS property clip has been removed from the Web standards.

The same result is achievable with

@mixin sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: circle(0% at 50% 50%);
  white-space: nowrap;
  border: 0;
}

@mixin sr-only-focusable {
  &:active,
  &:focus {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
    white-space: normal;
  }
}

View Demo here on jsfiddle

Reference
https://developer.mozilla.org/en-US/docs/Web/CSS/clip-path

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions