What might support for the ::part(...) pseudoelement look like? #18342
jamesarosen
started this conversation in
Ideas
Replies: 1 comment
-
It's possible to do this now with the custom selector escape hatch: <div class="m-10 p-10 border-2 [&::part(title)]:font-bold"> results in @layer utilities {
.m-10 {
margin: calc(var(--spacing) * 10);
}
.border-2 {
border-style: var(--tw-border-style);
border-width: 2px;
}
.p-10 {
padding: calc(var(--spacing) * 10);
}
.\[\&\:\:part\(title\)\]\:font-bold {
&::part(title) {
--tw-font-weight: var(--font-weight-bold);
font-weight: var(--font-weight-bold);
}
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Tailwind supports pseudo-elements like
::before
and::after
withbefore:mb-4 after:mt-4
.What would it look like to support the
::part
pseudo-element, which takes a part name argument? In CSS, it'sPerhaps
<my-element class="part(title):font-bold">
?See also the corresponding discussion on unocss/unocss
Beta Was this translation helpful? Give feedback.
All reactions