![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
![[community profile]](https://www.dreamwidth.org/img/silk/identity/community.png)
When they did the newest code push, I kind of fell in love with the Lefty theme. It's clean and gorgeous, and I just adore it. But I also have a thing for gradiations and rainbows in layouts, so now I'm thinking. I know the code I need to do to make the changes, I just don't know where I need to put it and if I need to make a whole new style to do it.
Basically, what I need to do is create 5 or 6 new class ids for the LI that make up the top navigation (which are currently "module-list-item"--I was planning on going for the creatively named "module-list-item-2" etc.) and then change the background color on those classes. That would allow me to have a lovely rainbow or multiple shades of the same colors or whatnot.
So... do I need to make a whole new style/layer? I'm a premium paid account, so that itself isn't the issue. I used to be pretty fluent in S2, but it's been, uh, several years, and in between the code changes and my brain writing over that information with mostly useless trivia, I'm stuck.
ETA: This is what I've come up with. First you need to delete the hexcode colors from "Background color for the header navigation on current page" and "Background color for the header navigation on hover" under Header on the Colors panel of customization. Then add the following to your CSS code:
This does make it hard to see if you're hovering over a link; I added the following bit of CSS to make the links underline when hovered: .module-navlinks li a:hover { text-decoration: underline;}
ETA2: Thanks to
syntheid and
ninetydegrees, I have sort-of figured out the customs CSS for this layout. My next question is closely related. Is there a way to link the color of the page header background to the color of the current page's link? E.g. on "recent" it would be green, "archive" yellow, "reading" red, etc.?
Basically, what I need to do is create 5 or 6 new class ids for the LI that make up the top navigation (which are currently "module-list-item"--I was planning on going for the creatively named "module-list-item-2" etc.) and then change the background color on those classes. That would allow me to have a lovely rainbow or multiple shades of the same colors or whatnot.
So... do I need to make a whole new style/layer? I'm a premium paid account, so that itself isn't the issue. I used to be pretty fluent in S2, but it's been, uh, several years, and in between the code changes and my brain writing over that information with mostly useless trivia, I'm stuck.
ETA: This is what I've come up with. First you need to delete the hexcode colors from "Background color for the header navigation on current page" and "Background color for the header navigation on hover" under Header on the Colors panel of customization. Then add the following to your CSS code:
.module-navlinks li,
.module-navlinks li a {
background: #COLOR ONE HEXCODE;
}
.module-navlinks li + li,
.module-navlinks li + li a {
background: #COLOR TWO HEXCODE;
}
.module-navlinks li + li + li,
.module-navlinks li + li + li a {
background: #COLOR THREE HEXCODE;
}
.module-navlinks li + li + li + li,
.module-navlinks li + li + li + li a {
background: #COLOR FOUR HEXCODE;
}
.module-navlinks li + li + li + li + li,
.module-navlinks li + li + li + li + li a {
background: #COLOR FIVE HEXCODE;
}
.module-navlinks li + li + li + li + li + li,
.module-navlinks li + li + li + li + li + li a {
background: #COLOR SIX HEXCODE;
}
.module-navlinks li + li + li + li + li + li + li,
.module-navlinks li + li + li + li + li + li + li a {
background: #COLOR SEVEN HEXCODE;
}
This does make it hard to see if you're hovering over a link; I added the following bit of CSS to make the links underline when hovered: .module-navlinks li a:hover { text-decoration: underline;}
ETA2: Thanks to
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
no subject
Date: 2013-05-08 04:29 pm (UTC).module-list li
is the first,.module-list li + li
the second, etc.no subject
Date: 2013-05-08 04:32 pm (UTC)no subject
Date: 2013-05-08 04:58 pm (UTC).module-list li,
.module-list li a {
background-color: #000;
}
.module-list li + li,
.module-list li + li a {
background-color: #666;
}
.module-list li + li + li,
.module-list li + li + li a {
background-color: #999;
}
etc.
Alternatively, each link has its own class already (.recent, .archive, etc.) so you could use that (but that probably implies restyling some other things).
no subject
Date: 2013-05-08 05:03 pm (UTC)element + next-element
it tells the CSS to look forelement
(aka in this case.module-list li
which is anyli
in the list with classmodule-list
) and then find whatever is right next to it that matchesnext-element
(akali
, so whateverli
follows the initial one) and then if you keep chainingli + li + li
will only affect the 3rd and following. Does that make more sense? If you're using a unique class/id it won't affect any other lists on the page. So you'll have a bunch of statements like:Except styled the way you want, of course.
no subject
Date: 2013-05-08 05:33 pm (UTC)no subject
Date: 2013-05-08 06:17 pm (UTC)no subject
Date: 2013-05-08 06:33 pm (UTC)no subject
Date: 2013-05-08 06:38 pm (UTC)I'm such a sucker for gradients and rainbows. I'm almost 30 years old, and if I get my hands on crayons or colored pencils, invariably, the first thing I draw is a rainbow.
no subject
Date: 2013-05-08 06:46 pm (UTC)no subject
Date: 2013-05-08 10:27 pm (UTC)body
that denote which page you're on--.page-recent
,.page-archive
,.page-read
and so on. So you could use those to style the headers on a per-page basis. I'm not entirely sure which part of the header you want to have match the background, but something like.page-recent #header { background: #COLOR; }
should work if you're talking about the bit that's currently blue.no subject
Date: 2013-05-08 10:45 pm (UTC)