Traditionally, I remember the rule that presentation should be managed by css, while behavior should be managed by javascript. But does the fact that some things can be reasonably done either way change - for example - a site's or app's maintainability? How about it performance? Is a CSS implementation rendered faster than javascript? I struggle with this at times, especially in some cases where - admittedly older -…
CSS is powerful, you can do a lot of things without JS
111–120 of 319 posts
Re: CSS is powerful, you can do a lot of things without JS
#112Earlier quoted context omitted.
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.
Mozilla (including Firefox) had XUL, but nobody cared.
Have you seen XUL? Here's an example, from https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Tu...
All that does is display a window with two buttons. You can imagine how hideous it could get when it got more complex. Now, imagine this alternative (I'm assuming that id & title are mandatory arguments, and that orient is optional, default to horizontal): (sul
(stylesheet "chrome://global/skin" "text/css")
(window "findfile-window" "Find Files"
(button "find-button" "Find")
(button "cancel-button" "Cancel")))
Which would you rather write in?Now, imagine that JavaScript were Scheme or Lisp instead, so that your browser interaction code were also written in an s-expression language. And imagine that CSS were s-expression-based, so that you were using the same tools to manipulate the same data everywhere.
It makes me weep.
Re: CSS is powerful, you can do a lot of things without JS
#113Re: CSS is powerful, you can do a lot of things without JS
#114Re: CSS is powerful, you can do a lot of things without JS
#115Whenever someone makes a menu with CSS instead of javascript i go crazy as a user. The lack of delay is such a frustration.
You like sluggishness?
Whenever I see a menu with CSS, I'm delighted: it means I needn't enable JavaScript (which opens up my computer to infection) just in order to read a list of links.
Re: CSS is powerful, you can do a lot of things without JS
#116Is it possible to display a "There are no records" message if a container is empty (i.e. tbody) using CSS only?
There is an :empty state you can use. I'm not looking at the demo right now but I've added messages like this: .container:empty:before { content: 'There are no Messages' }
Re: CSS is powerful, you can do a lot of things without JS
#117Earlier quoted context omitted.
Ah! I read the parent's post as sarcastic. But you are right, a little delay can be good.
There's a lot more to this than just "a little delay" to avoid accidental triggers. Good menus are complex. In desktop toolkits, there is a lot of logic to ensure they are accessible and don't behave in annoying ways. For example, a high quality menu will have a certain leeway to trigger into and out of submenus so that you don't accidentally drift into the incorrect submenu should you make an error of a couple of pi…
Re: CSS is powerful, you can do a lot of things without JS
#118Earlier quoted context omitted.
Hmmm... .accordion .content { padding:0 10px; overflow:hidden; border:1px solid #fff; -webkit-transition: all .5s ease-out; -moz-transition: all .5s ease-out; } -webkit-transition, -moz-transition... it's like we're at 180 degrees to where the web was in the days of IE4-6
Remember when Good Developers would hate on framesets because they break the back button and linking and everything? Now it's totally OK to break all that with AJAX and "text-as-apps"... I much prefer the days of the old web.
Re: CSS is powerful, you can do a lot of things without JS
#119Earlier quoted context omitted.
Remember when Good Developers would hate on framesets because they break the back button and linking and everything? Now it's totally OK to break all that with AJAX and "text-as-apps"... I much prefer the days of the old web.
Days of the old web where flash was pervasive and best viewed in [IE6|Netscape|Mosaic|...] pages were everywhere. Every generation of the web has had really crappy devs building bad experiences. The current generation is not making anything worse than it's predecessor.
That's a pretty low bar.
Re: CSS is powerful, you can do a lot of things without JS
#120Earlier quoted context omitted.
Hmmm... .accordion .content { padding:0 10px; overflow:hidden; border:1px solid #fff; -webkit-transition: all .5s ease-out; -moz-transition: all .5s ease-out; } -webkit-transition, -moz-transition... it's like we're at 180 degrees to where the web was in the days of IE4-6
Remember when Good Developers would hate on framesets because they break the back button and linking and everything? Now it's totally OK to break all that with AJAX and "text-as-apps"... I much prefer the days of the old web.
A crappy, lazy developer won't care about state history. A good developer will. You can do things right if you want to. It's more work but not a huge amount more.