CKTIS / CSS
corner-right-shape — forme des coins droits
Un raccourci CSS qui définit la forme des coins supérieur droit et inférieur droit sans modifier leurs rayons.
Version : CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
Syntaxe
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 définit corner-top-right-shape et corner-bottom-right-shape, dans l’ordre haut–bas. Une seule valeur s’applique aux deux coins. La propriété cible le côté droit physique, quelle que soit la direction d’écriture.
Les rayons sont déterminés par border-radius ; avec un rayon nul, aucun effet de forme n’est visible. La forme initiale est round ; les propriétés ne sont pas héritées.
Cette fonctionnalité est décrite dans un brouillon du CSSWG. Le périmètre de Chromium 152 ne suffit pas à confirmer sa prise en charge ; l’exemple doit être vérifié localement.
Exemples
<!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>Résultat
Right corner shorthand check: PASS
Le code affiché et le résultat déclaré ont été vérifiés dans un environnement isolé selon la méthode consignée dans la preuve de vérification de cette version exacte.