Is it possible to animate ::marker which has content defined explicitly ?
I tried rotating the marker but it doesn't work . Here is the codepen https://codepen.io/sougataghar47/pen/qEWMVPY
8 Replies
::marker only allows limited amount of properties to be use https://developer.mozilla.org/en-US/docs/Web/CSS/::marker#allowable_properties
MDN Web Docs
::marker - CSS: Cascading Style Sheets | MDN
The ::marker CSS pseudo-element selects the marker box of a list item, which typically contains a bullet or number. It works on any element or pseudo-element set to display: list-item, such as the and elements.
this doesnt work
transition is not a transform my guy
i would hide the marker and use pseudo element like ::before
this came to my head as well but thought there should be a better way but gonna try it 🙂
In your current Ccodepen you aren't weren't (I see that you have now added it) actually telling it to rotate.
You had defined the transition but, as @Mannix has pointed out, you hadn't defined the transform (or rotate) when the details are open.
"transition" is only defining how an element will move/rotate/change etc. It is not actually telling the element to do it.
That said, even if you do add the transform I don't think that it will work. Your best bet is to add your own marker, again as Mannix has suggested.
why does it need
position:absolute
to work properly ? If I remove it , it doesn't workpseudo-elements don't have a
display
type by default, so they need something to tell them how to render on the page.
Giving them a position
does that, which is why you need the position: absolute there.
You can also use declare a display
value... or, if the parent is flex
or grid
, that makes them a grid or flex item, so they'll appear then too.
(all assuming you have content
as well).thank you so much for replying but I noticed it doesn't work with
position:relative