Live data from Hacker News

CSS is powerful, you can do a lot of things without JS

github.com

181–190 of 319 posts

Re: CSS is powerful, you can do a lot of things without JS

#181

Earlier quoted context omitted.

the thing is that we don't always start working on sites from scratch. more often I have to clean up someone else's mess or my own that I made months or years ago. in that case I'd rather debug javascript than css.

Yeah, I think it's a lot easier to fix shitty JS than it is to fix shitty CSS. Every job I've had, I've fixed more than I build. If it's a 5 person startup, I'm iteratively fixing my own shit as the product pivots. If it's 30 people, I'm fixing code from that one idiot that interviewed well and turned out to be impressively terrible. If it's a 10,000 person company, I'm fixing shit from that entire division that wasn…

my entire career in 2 lines

Re: CSS is powerful, you can do a lot of things without JS

#182
post #122

I've worked with people who did things like this. It's not fun for anyone else on the team to try and figure out why you're using specific pseudo selectors on tags in a child inside a sibling in some label to make an accordion that would take 3 lines in Javascript.

I'm interested in seeing these 3 lines of Javascript that can implement an accordion.

With a sane limit to number of characters on each line as well.

Re: CSS is powerful, you can do a lot of things without JS

#183

Earlier quoted context omitted.

I'm very curious about this: is there a hypothesis that non-mobile computers are going away in the business world and/or that "young people" will not be involved in that world? I don't know the stats - are tablets making big inroads in business computing?

Dunno. But my niece and nephew are tablet/phone experts, and have never used a mouse. And they are 4 and 6.

I think that just means new computing devices have expanded the market, not replaced old devices. Some functionality that was once used exclusively on PCs (what else did you have?) may now be more commonly accessed via mobile devices. You didn't have a PC in your pocket when you needed to look up directions on a map..

Re: CSS is powerful, you can do a lot of things without JS

#185
post #81

Earlier 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

transition has been standardized and available in all browsers for years already, that is only necessary as fallback for very old browsers.

The only reason I use the webkit prefix on transition is for Android, otherwise I would say it isn't necessary at all.

Re: CSS is powerful, you can do a lot of things without JS

#186
post #122

I've worked with people who did things like this. It's not fun for anyone else on the team to try and figure out why you're using specific pseudo selectors on tags in a child inside a sibling in some label to make an accordion that would take 3 lines in Javascript.

I'm reminded of the Jurassic Park quote when I see people doing "neat" complicated CSS hacks to do stuff a line of JS would do...

"Yeah, yeah, but your scientists were so preoccupied with whether or not they could that they didn't stop to think if they should."

Re: CSS is powerful, you can do a lot of things without JS

#187
post #141

Earlier quoted context omitted.

CSS animations are generally on par with JavaScript, except when they're hardware accelerated. But that's changing once web animations ( https://w3c.github.io/web-animations/ ) hits mainstream anyway - both CSS & JS get access to the same engine.

The point of CSS animations isn't HW accel - you get that just from layerization. What it does get you is animations executing off the JS thread, so if you have piles of third party JS it won't cause frame drops.

Good point.

If you use Wordpress, like millions of people do, you will have a fuck ton of JS plugins running, so I can see where this would be advantageous.

Re: CSS is powerful, you can do a lot of things without JS

#188

Is it wrong of me to not like using the css content property? I feel like actual content shouldn't be in css.

It depends on context. If it's stylistic content, then I say it's reasonable. If it's the main body of your blog post, then maybe just wrap it in a

tag.

Re: CSS is powerful, you can do a lot of things without JS

#189
post #122

I've worked with people who did things like this. It's not fun for anyone else on the team to try and figure out why you're using specific pseudo selectors on tags in a child inside a sibling in some label to make an accordion that would take 3 lines in Javascript.

Do you know of a Github repo that implements these features in javascript? I would love to learn how.

[deleted]

Re: CSS is powerful, you can do a lot of things without JS

#190
post #122

I've worked with people who did things like this. It's not fun for anyone else on the team to try and figure out why you're using specific pseudo selectors on tags in a child inside a sibling in some label to make an accordion that would take 3 lines in Javascript.

Do you know of a Github repo that implements these features in javascript? I would love to learn how.

Most of these (carousel, tool tips, modals, etc.) are in the very popular Bootstrap.
Post reply on HN