Still not good enough. For example the popover/tooltip that pops up on hover is fixed right below the target. If for example the viewport/window is smaller than the available space it will "bleed" out of view. You still need javascript to place it properly, and javascript that manipulates :after and :before pseudo elements is not straightforward.. Just saying :)
More to the point :target can only target one element at most, since fragment is unique. the other stuff ranges from clever tricks, like the label/checkbox modal, to stuff which would be a nightmare to maintain on a complex page
CSS is powerful, you can do a lot of things without JS
71–80 of 319 posts
Re: CSS is powerful, you can do a lot of things without JS
#72On a side note, HTML + CSS3 is Turing complete: https://news.ycombinator.com/item?id=2300836
Re: CSS is powerful, you can do a lot of things without JS
#73Whenever someone makes a menu with CSS instead of javascript i go crazy as a user. The lack of delay is such a frustration.
You can always use transitions to add the same effect. I personally enjoy when things open quickly, some people almost fetishize transitions to an absurd level.
Re: CSS is powerful, you can do a lot of things without JS
#74Even if you can do a lot of stuff in css, sometimes you shouldn't do them. Razvan Caliman from Adobe has some good points on this topic: https://youtu.be/WupAsZGHDcY
Re: CSS is powerful, you can do a lot of things without JS
#75So in the first modal example, the document contains both dialog windows at the same time. Is that really what you want? Does that properly describe the content of your document?
How else would you do it, even in JavaScript?
Re: CSS is powerful, you can do a lot of things without JS
#76The problem with using css this way is that it's not as obvious what's supposed to happen as it is when using js. I'd love for there to be some explanation within the examples of _why_ they work - I've just been reading the first modal example but I can't really understand it
Building web applications with screens that have complex workflows and state is a need that is largely ignored by browsers and web standards. Instead of getting reusable gui components we get indechiperable css hacks that were built for creating art installations on the web rather than getting any actual work done.
Re: CSS is powerful, you can do a lot of things without JS
#77I think it would actually be wise to stick to JS style rendering (as is the case with React) as we're only going to see more and more styling being delegated to scripts with the rise of wasm. Only a matter of time before CSS will only really be useful for completely static websites IMO. Edit: Downvoting me because you disagree isn't really in the spirit of HN. Please provide a counter argument if you disagree, I'd be…
Re: CSS is powerful, you can do a lot of things without JS
#78Earlier quoted context omitted.
CSS ( properly written ) is easier to debug than JS.
Easier to find the bug harder to fix I think. The problem is CSS has a global scope - you change one thing and breaks the whole site's layout. With javascript usually code affects more specific areas of the site/web app.
Re: CSS is powerful, you can do a lot of things without JS
#79Earlier quoted context omitted.
CSS ( properly written ) is easier to debug than JS.
Easier to find the bug harder to fix I think. The problem is CSS has a global scope - you change one thing and breaks the whole site's layout. With javascript usually code affects more specific areas of the site/web app.
Re: CSS is powerful, you can do a lot of things without JS
#80The problem with relying on anchors means it stays in the browser history, so if you press 'back', you get the modal dialog again! I don't think this is very useful, but it is a fun exercise in CSS.