justmoon / relative-numbers

Relative line numbers package for Atom
https://atom.io/packages/relative-numbers
MIT License
37 stars 16 forks source link

Can't style the relative number span element #29

Open akonwi opened 7 years ago

akonwi commented 7 years ago

I'm creating a theme and before atom 1.13, I had some styling to change the color of the number on the current line. Once atom 1.13 came out, I noticed the styling was buggy and it was probably because atom removed the pseudo selectors api, so I disabled relative-numbers.

Today, I re-enabled the package and updated it and now the style rules of my theme aren't applied.

Here's the style block:

.relative.current-line {
  color: @white;
}

Am I missing something? I've also used the same selector that the dev tools is showing me for the block that declares the color: #2196f3, but that doesn't work either.

justmoon commented 7 years ago

Have you tried

atom-text-editor.editor .relative.current-line {
  color: purple
}

as suggested in the README?

akonwi commented 7 years ago

Yea I've tried that to no avail. Even in my local stylesheet that doesn't work.

What I eventually figured out was that the selector .relative.current-line was not getting found. I could use it in the dev tools and it would find the element but from my stylesheets there was nothing. What I've done is replace the class selector with span and that works.

More specifically, it looks like this:

atom-text-editor {
  .gutter {
    .line-number {
      &.cursor-line {
        span {
          color: white
        }
      }
    }
  }
}