This topic was marked solved by its starter, on January 31st, 2014, 10:41 PM
Parent CSS overwriting children.

Zaiken

  • I haven't programmed much since vrml was new.
  • Posts: 8
Parent CSS overwriting children.
« on January 27th, 2014, 09:37 AM »
It seems like at least some parts of the parent skins are taking priority over customization to the child. i.e., Wine overwrites Wuthering's extra.css. I attempted to make a copy of wuthering, but when the extra.css was changed in the customized skin nothing happened. When I edited Wine, the css carried over. Even using !important does nothing. It doesn't seem to load the css at all if the parent exists.

Nao

  • Dadman with a boy
  • Posts: 16,077
Re: Parent CSS overwriting children.
« Reply #1, on January 27th, 2014, 10:10 AM »
I've never experienced this, and I wrote the whole thing.

Wuthering specifies Wine as its parent in the skin.xml file.
Wedge builds a chain of nested skins (Weaving < Wine < Wuthering), and then proceeds to load the CSS in order (Wuthering in last, then.)
If you can't override a setting from Wine, you may have done it incorrectly.

The first thing to test is using the reset keyword. Just add it to a selector you want to restyle from scratch. Just use #linktree reset instead of #linktree if you're about to overwrite the linktree. Ensure that you copy all CSS you want to keep from the parents, of course. 'reset' will delete *any* CSS declarations prior to the one found in that place, so even declarations found within the same extra.css file will be erased if they're made before. All right..?

Then, there's the order in which files are loaded. 'extra.css' comes after 'index.css' and 'sections.css', so it should override anything in those, regardless of whether they're in Weaving, Wine or your own skin. So, normally you've got everything covered here.

Zaiken

  • I haven't programmed much since vrml was new.
  • Posts: 8
Re: Parent CSS overwriting children.
« Reply #2, on January 29th, 2014, 02:16 PM »
Not sure what I did wrong the first time. But I followed your instructions and it worked. You can go ahead and delete this, it was my mistake.

Nao

  • Dadman with a boy
  • Posts: 16,077
Re: Parent CSS overwriting children.
« Reply #3, on January 29th, 2014, 04:04 PM »
The skin system can be a bit overwhelming when you first start using it, but very soon you'll see that there's nothing easier, and it's much better (and more powerful) than Themes+variants in SMF. Let alone less awkward to use!

I'm not done with my work on skins, though, so stay tuned. (I'm not planning to remove or break anything, so you should be able to create new skins, but I *may* do some work on <ul> and <li> tags in Weaving -- actually I started last month but haven't committed anything yet-- meaning you'll have to fix your lists if you style them in your skins.)