CKTIS / CSS
corner-right-shape — vorm van de rechterhoeken
Een CSS-shorthand die de vormen van de rechterbovenhoek en rechteronderhoek instelt zonder de bijbehorende stralen te wijzigen.
Versie: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
Syntax
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 stelt corner-top-right-shape en corner-bottom-right-shape in, in de volgorde boven–onder. Eén waarde stelt beide hoeken in. De eigenschap richt zich op de fysieke rechterkant, ongeacht de schrijfrichting.
border-radius bepaalt de stralen; bij een straal van nul is er geen zichtbaar vormeffect. De beginvorm is round; de eigenschappen worden niet overgeërfd.
Deze functie is beschreven in een CSSWG-concept. Alleen het bereik van Chromium 152 bevestigt geen ondersteuning; het voorbeeld moet lokaal worden gecontroleerd.
Voorbeelden
<!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>Resultaat
Right corner shorthand check: PASS
De getoonde code en het opgegeven resultaat zijn in een geïsoleerde omgeving geverifieerd met de methode die in het verificatiebewijs voor exact deze versie is vastgelegd.