DEV Community

Discussion on: CSS Only Modal using target

Collapse
 
johnkazer profile image
John Kazer • Edited

I don't really want my app state spread over CSS, HTML, JavaScript... How would you ensure that "easily animate between states" within CSS doesn't cause confusion and complexity?

Collapse
 
mandrewdarts profile image
M. Andrew Darts

Great point! I would stray away from this in a medium to large size application for the same reason.

This is a nice technique for someone who is doing a simple marketing site that doesn't really have "state".

I would argue that some state is already in CSS. A lot of these are pseudo selectors. :hover, :focus, & :checked are examples of this.

I am not saying this is the "correct" way to do it, but a simple one for a simple use case. It is all based around your needs for your specific project.