Getting ready for an alpha release: CSS fixes

Pandos

  • Living on the edge of Wedge
  • Posts: 635
# dpkg-reconfigure brain
error: brain is not installed or configured

Powerbob

  • Posts: 151

markham

  • Finally finished the Slideshow... phew!
  • Posts: 138

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Getting ready for an alpha release: CSS fixes
« Reply #18, on September 3rd, 2012, 07:51 AM »
(Back from a BBQ party that lasted all day at my place... 30 people there, what a mess >_< My girlfriend definitely has a lot of cousins I never heard from until now.) (Some of them quite on the cute side, mwahah.) (Don't mind me.)

b isn't much of a problem. After all, thinking about it, a theme's quality is determined by the viewer, not by its author. It's up to the author to ensure it works best for users. Having media queries make their life more complicated, is trumped by the fact that users won't get that dreaded FOUC.

HTML arrows are more of a problem. Indeed, IE9 and Firefox don't play well with horizontal arrows in menu items. I had to make a specific rule for them, and even then IE9 will show the arrows under the text (if the text is the longest in the menu item list, otherwise it works as expected).
Also, there are a few complications that I'll have to deal with. One of these is caused by a limitation in the "&" keyword.

This is a simplified version of the horizontal arrow code, taken from common.css, with only the code that interests me right now:

Code: [Select]
.horizontal_arrow virtual
:after
opacity: .25
&:hover:after
opacity: .5

But nested menu items are a problem, because :hover doesn't apply on parent items. For that reason, I implemented long ago a .hove class on the parent <li>, so that I can target .hove & (instead of &:hover), and be done with. Here's where it gets funny... The selector that inherits .horizontal_arrow is called "li.subsection > a". Which is fine in regular times... However, doing ".hove li.subsection" doesn't work because it really is "li.subsection.hove" I should be targeting. But then, how do I represent that in WeCSS code...? Doing ".hove &" won't do, but "&.hove" won't do either, because it's developed to "li.subsection > a.hove"... And, anyway, it's never a good idea to add a 'specific' class like .hove to a 'generic' virtual like .horizontal_arrow!

(x) So, one way of doing it could be to 'simply' apply the hove class to both the li parent and its anchor child. I like the idea, but it means a few more bytes in the JS code, and it contradicts what I just said about what a good idea is...

(y) An alternative would be to only care about &:hover, as above (or even not at all?), and instead have an extra rule in index.css do the opacity change (i.e. clearly add a "li.hove > a" selector in plain view).

(z) Finally, another alternative is (very similarly to (y)) to simply remove that specific horizontal rule from the common definitions list, because it's really only used in the menu items, so I could just have the code above inserted into index.css. (There is also another horizontal_arrow class for inline elements.)

All in all, the CSS for HTML arrows is a bit weightier than the background-image version, because the image is only 150 bytes and when gzipped, its base64-encoded version is around that size. Of course, it's likely that the gzipped version of the CSS code above is smaller than 150 bytes, I'm not exactly sure. But still, it's funny that by trying to remove a few background-image hacks that were in the original arrow code, I ended up finding new issues with various browsers... (Even when taking IE6 and IE7 aside, as they never supported the background-image version really well anyway.)

What do you think, guys...?
Posted: September 3rd, 2012, 12:44 AM

:edit: Edited this post to add clear separations between multiple choices.

godboko71

  • Fence accomplished!
  • Hello
  • Posts: 361
Re: Getting ready for an alpha release: CSS fixes
« Reply #20, on September 4th, 2012, 05:08 PM »
If HTML is a no go do what feels best to you. This is clearly something that can change after alpha is you or someone else comes up with a better way.
Thank you,
Boko

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Getting ready for an alpha release: CSS fixes
« Reply #21, on September 4th, 2012, 07:14 PM »
I think a lot of it is that I don't really think we can fully understand the consequences for the changes, that's one of the problems. I have no idea of what the consequences will be for any of the choices.

(Edit: I got the new reply warning)
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

spoogs

  • Posts: 417
Re: Getting ready for an alpha release: CSS fixes
« Reply #22, on September 4th, 2012, 09:37 PM »
I don't really have a take on this, mainly because I'd probably not be using it reduced. If I had a preference I think I'd rather the sidebar be hidden. Having to choose from the options above I'd go with b since thats where everyone else seems to be :P
Quote from Arantor on September 4th, 2012, 07:14 PM
I think a lot of it is that I don't really think we can fully understand the consequences for the changes, that's one of the problems. I have no idea of what the consequences will be for any of the choices.
^^^This is me for sure ^^^
Stick a fork in it SMF

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Getting ready for an alpha release: CSS fixes
« Reply #23, on September 4th, 2012, 10:17 PM »
And without wishing to be arrogant or modest, or whatever perspective you might want to draw from it, if *I* don't understand the consequences of these, I doubt anyone else will either... That's one of the downsides to something this complicated.

Oracle

  • Posts: 78
Re: Getting ready for an alpha release: CSS fixes
« Reply #24, on September 4th, 2012, 10:28 PM »
Quote from spoogs on September 4th, 2012, 09:37 PM
I don't really have a take on this, mainly because I'd probably not be using it reduced. If I had a preference I think I'd rather the sidebar be hidden. Having to choose from the options above I'd go with b since thats where everyone else seems to be :P
Quote from Arantor on September 4th, 2012, 07:14 PM
I think a lot of it is that I don't really think we can fully understand the consequences for the changes, that's one of the problems. I have no idea of what the consequences will be for any of the choices.
^^^This is me for sure ^^^
Your not alone Spoogs!

Norodo

  • Oh you Baidu, so randumb. (60 sites being indexed at once? Jeez)
  • Posts: 469
Re: Getting ready for an alpha release: CSS fixes
« Reply #25, on September 5th, 2012, 02:17 AM »Last edited on September 5th, 2012, 02:26 AM
Quote from Nao on September 3rd, 2012, 07:51 AM
What do you think, guys...?
I say go for x, but make a comment in the CSS so that people will know that JS witchcraft is being performed. Seems to me to be the least horrific way to go about things. If people have JS disabled it won't change too much, and if they have it enabled it won't be the end of the world.

CSS is so neat at most times, but can be oh so stupid for some things.

EDIT: http://www.w3.org/TR/selectors4/#subject <-- In five years we will all be telling new CSS users how lucky they are to have all the neat tools they currently have, and they will still whine that CSS is insufficient. It will be grand times

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Getting ready for an alpha release: CSS fixes
« Reply #26, on September 5th, 2012, 05:30 PM »
Quote from Norodo on September 5th, 2012, 02:17 AM
I say go for x, but make a comment in the CSS so that people will know that JS witchcraft is being performed. Seems to me to be the least horrific way to go about things. If people have JS disabled it won't change too much, and if they have it enabled it won't be the end of the world.
I dunno, I've been thinking about it and I'll probably go for the specific hack -- if only because I really don't want people to think it's something they should use in their own skins, ah ah.
Quote
CSS is so neat at most times, but can be oh so stupid for some things.
Tell me about it.
I think overall, WeCSS took me over 6 months to develop (1 month for the main code, 5+ months for bug fixes and improvements.) Had I known earlier, I probably would...have done it again. It's just that it isn't Wedge. It's just a cool part of it... But it's also the most invisible part to most people: with today's bandwidths, you don't really see a difference at load time (most of my time savers aren't related to WeCSS).
Quote
EDIT: http://www.w3.org/TR/selectors4/#subject <-- In five years we will all be telling new CSS users how lucky they are to have all the neat tools they currently have, and they will still whine that CSS is insufficient. It will be grand times
Don't see what you're pointing to...

The only 'important' thing I feel that CSS is missing (and that is hardly targetable in WeCSS either), is "selector < subselector", i.e. "target any selector that has the specific subselector". That one would be so dead cool... And I don't care about performance issues, eh!

Norodo

  • Oh you Baidu, so randumb. (60 sites being indexed at once? Jeez)
  • Posts: 469
Re: Getting ready for an alpha release: CSS fixes
« Reply #27, on September 5th, 2012, 05:51 PM »
Quote from Nao on September 5th, 2012, 05:30 PM
The only 'important' thing I feel that CSS is missing (and that is hardly targetable in WeCSS either), is "selector < subselector", i.e. "target any selector that has the specific subselector". That one would be so dead cool... And I don't care about performance issues, eh!
Check out the table at the beginning of the draft. TL;DR you will be able to do parent selection by doing E! > F.

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Getting ready for an alpha release: CSS fixes
« Reply #28, on September 5th, 2012, 07:22 PM »
lol, the link didn't work on my iPod actually... It works in Opera. And I'm stunned, you linked precisely to a proposed fix for the issue I mentioned! I promise I didn't read that page :lol:

Norodo

  • Oh you Baidu, so randumb. (60 sites being indexed at once? Jeez)
  • Posts: 469