1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 01:07:35 +00:00

LibWeb: Implement the CSS outline-offset property

This allows you to push the outline a certain distance away from the
border (or inside it, if the offset is negative).
This commit is contained in:
Sam Atkins 2023-08-02 20:09:10 +01:00 committed by Andreas Kling
parent fe7e797483
commit 73fa58da34
8 changed files with 70 additions and 7 deletions

View file

@ -42,9 +42,14 @@
}
.outline3 {
outline: 2px solid green;
outline-offset: 5px;
border-radius: 10px;
border: 2px solid black;
}
.outline4 {
outline: 1px solid red;
outline-offset: -20px;
}
</style>
</head>
<body>
@ -57,7 +62,7 @@
</div>
<div style="background-color:red;width:3px">This text should only have a strip of red on the left</div>
<div class="box">
<span class="outline">This text has an outline</span> and <span class="outline2">this text has an outline with a border radius,</span> and <span class="outline3">this also has a border.</span>
<span class="outline">This text has an outline</span> and <span class="outline2">this text has an outline with a border radius,</span> and <span class="outline3">this also has a border.</span> <span class="outline4">This outline is a strikethrough.</span>
</div>
</body>
</html>

View file

@ -6,6 +6,7 @@
p {
padding: 5px;
border: 2px solid black;
margin: 1em;
}
.outline-default {
outline: auto;
@ -21,6 +22,14 @@
color: saddlebrown;
outline: 5px dotted currentcolor;
}
.outline-offset {
outline: 5px solid blue;
outline-offset: 0.5em;
}
.outline-inset {
outline: 1px solid red;
outline-offset: -10em;
}
</style>
</head>
<body>
@ -29,5 +38,7 @@
<p class="outline-1">I have an outline!</p>
<p class="outline-2">I have an outline and a radius!</p>
<p class="outline-currentcolor">My outline is dotted and brown!</p>
<p class="outline-offset">My outline is blue and away from my border!</p>
<p class="outline-inset">My outline is a very thin red line in the middle of this box!</p>
</body>
</html>