Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the system font for header elements in popups #1515

Merged
merged 4 commits into from
Dec 7, 2020

Conversation

rwols
Copy link
Member

@rwols rwols commented Dec 7, 2020

No description provided.

Copy link
Member

@rchl rchl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What kind of content uses header elements and should we really apply those to all headers, even ones that come from a server? Or should we even just apply that font style to the whole popup? At this point, I'm not sure what doesn't use it since the p element does which is probably used in a lot of places.

popups.css Outdated Show resolved Hide resolved
@rwols
Copy link
Member Author

rwols commented Dec 7, 2020

What kind of content uses header elements and should we really apply those to all headers, even ones that come from a server?

<h1> is used a lot by clangd.

Or should we even just apply that font style to the whole popup?

I would say yes, but I don't know how to do that in a neat way, because I suck at css.

@rchl
Copy link
Member

rchl commented Dec 7, 2020

I would say yes, but I don't know how to do that in a neat way, because I suck at css.

So we could just have a font-family: system; in the top .lsp_popup selector. That will be inherited by all children unless something overrides font-family (or font, if ST supports that) to something else. Also, ST's internal styles might override it if those specify font-family for certain elements. But I don't know if they do.

But we can just have font-family on the top selector and if it doesn't apply to something then make a specific override for that.

@rwols
Copy link
Member Author

rwols commented Dec 7, 2020

Hmm... this also styles the diagnostics with the system font. I don't think that's an improvement.

Copy link
Member

@rchl rchl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels a bit random to me in which font-family style we style what. We target certain element types rather than certain content types.

But I guess it should be fine, we can think of a more generic solution later.

@rwols
Copy link
Member Author

rwols commented Dec 7, 2020

I managed to simplify it I think :) or can something go wrong with this?

}
.lsp_popup li {
font-family: system;
font-family: monospace;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how to "reset" the font-family here. The value monospace doesn't actually do what it is supposed to do: #1171 (comment)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are referring to a deleted line?
Not sure what do you exactly mean since the code doesn't look like that anymore.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wrote font-family: monospace; here, but that doesn't actually work as you'd expect. It just so happens to work. But the behavior is unconfirmed on Windows.

The only special font-family is presumably system.

@rwols rwols merged commit d772f93 into st4000-exploration Dec 7, 2020
@rwols rwols deleted the fix/header-styling branch December 7, 2020 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants