News for hackers. Stuff that matters.
Re:Show HN: A visual guide to the most popular CSS properties by archildress on Thursday November 24, 2016 @08:48PM (#13033918)
Quick question: this refers heavily to Flexbox, which as someone who has only a tangental interest in CSS, I don't know much about. Is it the standard way of doing positioning now? Care to explain it like I'm 5?
Re:Show HN: A visual guide to the most popular CSS properties by pault on Thursday November 24, 2016 @10:44PM (#13034289)
Flexbox is conceptually more difficult than older float & grid based layout systems (it takes some time to wrap your head around the relationship between `display: flex` containers and the various flex-* properties that child elements utilize), but it makes certain things dead simple that were nearly impossible before. For example, vertically centering content (almost comically difficult before flexbox) and fixed-width elements mixed with expanding elements that will share unused space in a row. In a lot of ways flexbox acts like old-school table layouts--which were easy to use and predictable--but without the ugly, non-semantic, and verbose markup. Best of both worlds really.

They are supported in all self-updating browsers, so unless you have to support IE<=10 they are safe to use and extremely convenient. Replacing a classic grid-based layout with flexbox saves an astonishing amount of markup. I've been using it exclusively for the last six months or so.

I found this CSSTricks article helpful when I was building my first flexbox layouts: https://css-tricks.com/snippets/css/a-guide-to-flexbox/

Re:Show HN: A visual guide to the most popular CSS properties by wapz on Friday November 25, 2016 @12:33AM (#13034594)
Thanks for the info. I did some simple CSS/HTML work a long time ago and never heard of flexbox (and it's everywhere on this page)
Re:Show HN: A visual guide to the most popular CSS properties by Drdrdrq on Thursday November 24, 2016 @11:19PM (#13034386)
+1 for linking to Complete Guide to Flexbox. This guide is really great!
Re:Show HN: A visual guide to the most popular CSS properties by zem on Friday November 25, 2016 @03:15AM (#13035044)
ooh, mixing fixed-width with expanding elements is exactly the thing i'm struggling with now. i'll look into converting from grid to flex based layout and see how that goes.
Re:Show HN: A visual guide to the most popular CSS properties by pault on Friday November 25, 2016 @05:00AM (#13035539)
You can also use calc(100% - [fixed container width]px) in a pinch.
Re:Show HN: A visual guide to the most popular CSS properties by archildress on Friday November 25, 2016 @02:08PM (#13039089)
Thanks so much, this makes sense!
Re:Show HN: A visual guide to the most popular CSS properties by shakna on Thursday November 24, 2016 @09:32PM (#13034053)
It can be easier than other ways of positioning in CSS, but you may need to be careful on relying on it, depending on your target audience, and what browsers they use. [0]

[0] http://caniuse.com/#search=flexbox

Re:Show HN: A visual guide to the most popular CSS properties by jrapdx3 on Friday November 25, 2016 @01:04AM (#13034663)
I think you're right on both counts. After getting the hang of it, flexbox is pretty straightforward to use, IMO less confusing and touchy than floats, especially for responsive layouts.

Most browsers are OK these days, but IE/Edge is where I've encountered the most problems with compatability. There are ways to work around it, but that takes a bit of additional effort. CSS tools, e.g., Autoprefix are useful.

Re:Show HN: A visual guide to the most popular CSS properties by shakna on Friday November 25, 2016 @01:26AM (#13034712)
Absolutely, flexbox is great.

My comment with browsers, is more about knowing your audience. Most of the evergreen browsers do support flexbox but...

Well, I maintain a website for a company.

97.3% of visitors, are return visitors.

69.77% of the visitors are using a version of Internet Explorer.

69.03% of the visitors are using Internet Explorer 7.0.

I have no hope of getting to use flexbox to simplify managing the website, which makes me very sad.

Re:Show HN: A visual guide to the most popular CSS properties by majewsky on Friday November 25, 2016 @04:14AM (#13035304)
I would try communicating to my manager that maintaining IE 7 support is costly for you. When you work on some IE-7-specific issue, log your time, and show them an actual rundown. Maybe that will tilt the cost-benefit analysis far enough to push them into upgrading their default browser.

(By the way, I'm sympathetic with you. When I deployed a big feature in an intranet web application in 2012, it broke for dozens of users, and it took me days to track down the misplaced comma that broke the neck of the IE 7 JS parser.)

Re:Show HN: A visual guide to the most popular CSS properties by shakna on Friday November 25, 2016 @09:03AM (#13036757)
More than 69% of our regular users are on IE7, we just can't afford to drop that. (They do in fact get a pop up telling them to upgrade, but that had no noticeable affect on traffic).
Re:Show HN: A visual guide to the most popular CSS properties by majewsky on Saturday November 26, 2016 @08:02AM (#13043286)
He said it's an internal application IIRC, so someone in the company is responsible for that.
Re:Show HN: A visual guide to the most popular CSS properties by 91bananas on Friday November 25, 2016 @11:24AM (#13037767)
What country are you in? That is an alarming rate of ie7 traffic
Re:Show HN: A visual guide to the most popular CSS properties by shakna on Friday November 25, 2016 @05:50PM (#13040411)
Not sure country counts at all when looking at this stuff, because individual sites very rarely reflect national trends.

However, that particular site is Australian, where Chrome makes up ~50% of traffic.

Re:Show HN: A visual guide to the most popular CSS properties by chrisfosterelli on Thursday November 24, 2016 @10:36PM (#13034266)
Flexbox is really worth trying. It is a much more natural way to layout responsive components imo, and is great for layout design in particular.

However, that said, the majority of components I build are still not in flexbox. It's a useful tool in the toolset, but not sure I'd call it the new default yet.

Re:Show HN: A visual guide to the most popular CSS properties by werdnapk on Thursday November 24, 2016 @10:06PM (#13034158)
Only the first few properties are flexbox related (alphabetical order). Keep scrolling through the property list and you'll find the non-flexbox properties.
Re:Show HN: A visual guide to the most popular CSS properties by matthewhall on Thursday November 24, 2016 @08:56PM (#13033939)
All of the other positioning systems are still completely valid, it's just that some people (myself included) find it easier to center things horizontal + vertical and distribute items on the page.