1 pointby brightmood5 hours ago1 comment
  • brightmood5 hours ago
    Year for year, I try to find out how to get each post in HN a different color for the number so that I can easier navigate.

    Grey Red Grey Red ... It helps me same as a table with different row/column colors. Because when I need to callback information, I can remember, hey this was red! Next clue is I need to find a red label and a greyed out text. I wished there were more clues, but this is the best I know at the moment.

    Could you please support me and possibly others? I got Autism.

    • baobun3 hours ago
      What do you mean with "copy the css"? Do you want to style your own website the same way? Or use a similar theme for HN itself year-round?

      To figure out where styles come from, open Developer Tools in your browser and Inspect Element. You shoud see the HTML DOM element highlighted and its styles and where they come from on the right.

      In this case the alternating font colors aren't from CSS at all.

      • brightmood3 hours ago
        No I want to save what HN is use and add it to something like TamperMonkey user scripts so I get the alternating colors for HN permanently. I tried before but I failed. Do you know of a solution?
        • baobun2 hours ago
          Since it's not done via CSS here, I suggest not copying the existing approach directly but recreating the same effect using CSS only.

          If you look in the DOM tree / source like I proposed, you see that the list is already a table, so you can use that exact approach you already mentioned.

              table tr:nth-child(odd) td.rank{
                  color: red;
              }
              table tr:nth-child(even) td.rank{
                  color: green;
              }
          
          https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/S...