git-blame icon indicating copy to clipboard operation
git-blame copied to clipboard

Use existing font settings

Open jacwright opened this issue 11 years ago • 8 comments

git-blame appears to assume a dark UI instead of just using some existing classes to set font color.

screen shot 2014-08-13 at 10 27 42 am

Makes it hard to read the date when it is white on white.

jacwright avatar Aug 13 '14 16:08 jacwright

Actually if you look at the less file you can see it does rely on existing classes. It never actually sets a text color. It does set background-color, and even then by slightly darkening and lightening the @base-backgroud-color.

In your screenshot I don't understand why the background is white if the rest of your editor is dark. What theme are you using?

dmnd avatar Aug 13 '14 17:08 dmnd

Ahh, I see the problem. I'm using Atom Light UI and Atom Dark Theme. So because you're using the UI's background color rather than the background color for the gutter (whatever that is) it doesn't work right when the UI and the theme are mismatched.

I haven't done any extension development, so I'm not sure what the style is for gutter, but git-blame ought to use the same.

It's a great extension! Thank you for the time you've spent creating and supporting it.

jacwright avatar Aug 16 '14 15:08 jacwright

I haven't looked at this is a while but as Desmond said it's not hard coded. If the gutter background color is exposed we can switch to lighten that one instead easily. Will take a look into this.

On Saturday, August 16, 2014, Jacob Wright [email protected] wrote:

Ahh, I see the problem. I'm using Atom Light UI and Atom Dark Theme. So because you're using the UI's background color rather than the background color for the gutter (whatever that is) it doesn't work right when the UI and the theme are mismatched.

I haven't done any extension development, so I'm not sure what the style is for gutter, but git-blame ought to use the same.

It's a great extension! Thank you for the time you've spent creating and supporting it.

— Reply to this email directly or view it on GitHub https://github.com/alexcorre/git-blame/issues/22#issuecomment-52395639.

Alex Corre [email protected] 310.694.4325

alexcorre avatar Aug 16 '14 16:08 alexcorre

I briefly looked into this but didn't come up with anything I liked enough for a PR. Here's what I learnt in case you want to continue it @jacwright:

@import "syntax-variables" will import the less variables used by the syntax theme. Right now we're doing @import "ui-variables" which gives styles from the UI theme.

Once you @import "syntax-variables", you have a couple of relevant variables @syntax-gutter-background-color and @syntax-gutter-text-color. But there's not much else. And the rest of the 'default' style seem to be aligned with the UI theme, not the editor theme. For example, right now we are using the default styles for <a>s and also the .text-hightlight class. But both of these are aligned with the UI theme, not the editor theme.

dmnd avatar Aug 17 '14 04:08 dmnd

Thanks @dmnd! That will be a great help. I'll see what I can come up with.

jacwright avatar Aug 19 '14 15:08 jacwright

Hey @jacwright any ideas on a fix for this?

alexcorre avatar Sep 06 '14 20:09 alexcorre

I haven't looked into it. Things have been busy. I'll try and come back to it eventually.

jacwright avatar Sep 08 '14 18:09 jacwright

I added this in my ~/.atom/styles.less:

atom-text-editor::shadow .git-blame-mount,
atom-text-editor .git-blame-mount {

    @git-blame-bg-color: #222;

    .git-blame .git-blame-scroller {
        background-color: @git-blame-bg-color;
        border: none;

        .blame-lines .blame-line {
            &.line-bg-lighter { background-color: lighten(@git-blame-bg-color, 4%); }
            &.line-bg-darker { background-color: darken(@git-blame-bg-color, 4%); }
        }
    }
}

and it looks like this:

image

Maybe it will be helpful for someone.

mik01aj avatar Jun 20 '16 09:06 mik01aj