CKTIS / CSS
corner-top-right-shape — Form der oberen rechten Ecke
Die Eigenschaft corner-top-right-shape legt die Form der oberen rechten Ecke fest; ihre Größe bestimmt border-top-right-radius.
Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
Syntax
corner-top-right-shape: round | scoop | bevel | notch | square | squircle | superellipse(<number> | calc(infinity) | calc(-infinity));corner-top-right-shape betrifft die physische obere rechte Ecke, unabhängig von der Schreibrichtung. Die Eigenschaft wird nicht vererbt und hat anfangs den Wert round.
bevel erzeugt eine diagonale Abschrägung, scoop einen konkaven Bogen. Weitere Möglichkeiten sind notch, square, squircle und superellipse(). Die Eigenschaft legt die Form fest, nicht die Größe: Bei einem border-top-right-radius von null ist kein sichtbarer Effekt vorhanden.
Dieses Merkmal ist in einer sich weiterentwickelnden Spezifikation beschrieben. Das Beispiel muss lokal überprüft werden; allein die Aufnahme in die Spezifikation belegt keine Unterstützung in Chromium 152.
Beispiele
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>corner-top-right-shape bevel</title>
<style>
.tile {
width: 160px;
height: 100px;
background: #075985;
border-top-right-radius: 32px;
corner-top-right-shape: bevel;
}
</style>
</head>
<body>
<div class="tile" role="img" aria-label="Blue tile used to test a top-right corner bevel"></div>
<script>
if (CSS.supports('corner-top-right-shape', 'bevel')) {
console.log('corner-top-right-shape: supported');
const style = getComputedStyle(document.querySelector('.tile'));
const computed = style.getPropertyValue('corner-top-right-shape');
const shape = computed === 'superellipse(0)' ? 'bevel' : computed;
const [horizontal, vertical = horizontal] = style.borderTopRightRadius.split(/\s+/);
console.log(`top-right: ${shape}, ${horizontal} × ${vertical} corner region`);
console.log(`other radii (top-left, bottom-right, bottom-left): ${style.borderTopLeftRadius}, ${style.borderBottomRightRadius}, ${style.borderBottomLeftRadius}`);
} else {
console.log('corner-top-right-shape: unsupported');
}
</script>
</body>
</html>Ergebnis
corner-top-right-shape: supported top-right: bevel, 32px × 32px corner region other radii (top-left, bottom-right, bottom-left): 0px, 0px, 0px
Der angezeigte Code und das angegebene Ergebnis wurden in einer isolierten Umgebung mit der im Prüfnachweis für genau diese Version dokumentierten Methode verifiziert.