Skip to content

Commit

Permalink
pseudo-element instead of masked box-shadow
Browse files Browse the repository at this point in the history
  • Loading branch information
dutchcelt committed Jan 6, 2024
1 parent 740c434 commit 33b73b8
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions src/system-selectors.css
Original file line number Diff line number Diff line change
Expand Up @@ -349,17 +349,34 @@
fieldset:has(:user-invalid),
form:has(:user-invalid),
form :user-invalid:not(:focus-visible) {
position: relative;
outline: var(--system-stroke-thin) solid var(--system-invalid-color);
&::before{
position: absolute;
margin-inline-start: max(calc(var(--system-spacing-layout) * -1), calc(var(--system-spacing-double) * -1));
content: '';
width: 0px;
height: 100%;
display: block;
border-inline-end-width: 0;
border-inline-end-style: solid;
border-inline-end-color: var(--system-invalid-color);
}

&:is(fieldset) {
outline: 0;
box-shadow: -15px 0 0 var(--system-canvas), -18px 0 0 var(--system-invalid-color);
&::before{
border-inline-end-width: var(--system-stroke-thick);
}

}

&:is(form) {
outline: 0;
box-shadow: -16px 0 0 var(--system-canvas),
-17px 0 0 color-mix(in oklab, var(--system-invalid-color) 50%, var(--system-canvas));
&::before{
border-inline-end-width: var(--system-stroke-thin);
}

}
}

Expand Down

0 comments on commit 33b73b8

Please sign in to comment.