yeah this dosn’yt seem to work. also i don;y know if you know anything about this, but when someone tries to post a topic/post it says: Unknown error saving post, try again. Error: 500 Internal Server Error? Do you know how i can fix this?
The problem is that you’re not fully interpreting the :empty pseudo class. It needs an ENTIRELY empty element. Take that navigation <ul> and right click and “Edit as HTML”
There is white space in there. Removing the white space fixes the problem in the HTML.
So get rid of the white space. The code that generates the list needs to be hugging the <ul> and </ul> so that if nothings there, it’s completely empty with no white-space. E.g.
I’m thinking - in all cases other than this hiding one, the UL MUST have children LI correct? That accounts for every other case? As a first-child I mean.
Nah not with CSS alone do I think this is possible. I’m not an expert in SASS (I think preprocessors are stupid - but I still use it for work sometimes.)
This might be possible with SASS (not sure of the full capabilities.) but I highly doubt it. CSS alone it’s not possible I think. I thought about it…CSS3 did have a pseudo class for something like this (I think it could be manipulated for this situation) but even so, it got removed from the draft specification (even if it didn’t, support would be terrible.)
Long story short - either use JS to trim the white-space (and use @cpradio CSS) or venture into plugin/forking territory.
One thing to note is that users without JS will have those boxes still appear. Never tried running Discourse without JS but it’s something worth noting. I’d really try and get rid of the white-space in the HTML…
Yeah Discourse seems to be pretty JS-heavy so I imagine the UX will drop pretty significantly without JS. Compared to some random gray boxes, shouldn’t be too much of an issue I guess.
I wish :empty actually worked hte way it was originally designed…
I think there are versions of the drafts but I wouldn’t bother reading them. I just read the drafts as it comes out which isn’t TOO often so I’m at a point where it’s not too much of a hassle to read a new draft or what not. I read through the entire draft when I made my “Future of CSS” article where I read through the entire specificiation / new / old drafts finding features that might be coming in the future. Lots and lots of reading…