Base de conocimientosCentro de exámenes
ESEspañol
Elegir idioma13

CKTIS / CSS

corner-right-shape — forma de las esquinas derechas

Una abreviatura de CSS que establece la forma de las esquinas superior derecha e inferior derecha sin cambiar sus radios.

Versión: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required

Sintaxis

corner-right-shape: <'corner-top-left-shape'>{1,2};
<corner-shape-value> = round | scoop | bevel | notch | square | squircle | superellipse(<number> | infinity | -infinity)

corner-right-shape establece corner-top-right-shape y corner-bottom-right-shape, en orden de arriba a abajo. Un único valor establece ambas esquinas. Se aplica al lado físico derecho, independientemente de la dirección de escritura.

border-radius determina los radios; si el radio es cero, no se aprecia ningún efecto de forma. La forma inicial es round; las propiedades no se heredan.

Esta función está especificada en un borrador del CSSWG. El alcance de Chromium 152 por sí solo no confirma que sea compatible; el ejemplo requiere una verificación local.

Ejemplos

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Right corner shape shorthand</title>
  <style>
    #tile {
      width: 160px;
      height: 100px;
      background: teal;
      border-radius: 0 24px 24px 0;
      corner-right-shape: bevel round;
    }
  </style>
</head>
<body>
  <div id="tile" role="img" aria-label="Teal sample tile" aria-describedby="status"></div>
  <p id="status" role="status"></p>
  <p>The declaration requests a bevel at the top right and a rounded corner at the bottom right.</p>
  <script>
    const supported = CSS.supports('corner-right-shape', 'bevel round');
    const style = getComputedStyle(document.getElementById('tile'));
    const topShape = style.getPropertyValue('corner-top-right-shape');
    const bottomShape = style.getPropertyValue('corner-bottom-right-shape');
    const radiiUnchanged = style.borderTopRightRadius === '24px' && style.borderBottomRightRadius === '24px';
    const ok = radiiUnchanged && (supported
      ? (topShape === 'bevel' || topShape === 'superellipse(0)') && (bottomShape === 'round' || bottomShape === 'superellipse(1)')
      : (topShape === '' || topShape === 'round') && (bottomShape === '' || bottomShape === 'round'));
    document.getElementById('status').textContent = supported
      ? `Supported. Computed top-right shape: ${topShape}; bottom-right shape: ${bottomShape}.`
      : 'Unsupported. Both right corners use their rounded border-radius fallback.';
    console.log(`Right corner shorthand check: ${ok ? 'PASS' : 'FAIL'}`);
  </script>
</body>
</html>

Resultado

Right corner shorthand check: PASS

El código mostrado y el resultado declarado se verificaron en un entorno aislado mediante el método registrado en la evidencia de verificación de esta versión exacta.

Fuentes