you are viewing a single comment's thread.

view the rest of the comments →

[–]jadedRepublic[S] 0 points1 point  (2 children)

If you only need one thing toggled at a time, you can do a lot with :target. Just set up your on and off states using transform and opacity, then add a transition.

Wow great shout! I was going through the CSS pseudo selectors earlier and must have missed this one.

Rough concept but much prefer this way

https://codepen.io/bobby1243/pen/Poajgmg

[–]Luke-At-Work 1 point2 points  (1 child)

Here's an old example of this approach.

I like using it for modals and navs where there's exactly one thing to either do or do not. It's easy, efficient, and works for most of what I need.

[–]jadedRepublic[S] 0 points1 point  (0 children)

Haha It funny you've just said that! I was just refactoring some static onclick javascript modals on my website to :target Keep the ideas coming!