Converting from sass to nested vanilla css with layers (#147)

This commit is contained in:
Fredrik Jonsson 2026-03-10 14:14:55 +01:00 • committed by GitHub
commit 57244c3f33
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -0,0 +1,36 @@
/* Anchor */
@layer components {
.anchor {
--anchor-gap: .5rem;
--anchor-opacity: .4;
display: grid;
grid-template-columns: auto auto;
justify-content: start;
align-items: baseline;
gap: var(--anchor-gap);
a {
opacity: 0;
text-decoration: none;
width: fit-content;
}
&:has(:focus-visible),
&:hover {
a {
opacity: var(--anchor-opacity);
&:focus-visible,
&:hover {
opacity: 1;
}
}
}
}
p:has(+ .anchor) {
margin-block-end: 0;
}
}