Font-size-adjust

What I’m trying to do

Hello! I’m new here and I’m not an expert in CSS at all, but I noticed Obsidian (v1.12.7) doesn’t recognise font-size-adjust in CSS snippets (as can be seen from inspection). My understanding is that Electron is based on Chromium, which has had this CSS property for a few years now, so I might be missing something or doing something wrong. I use it a lot in custom CSS wherever possible because I have to deal with multiple languages, with uncommon Latin/Greek/Cyrillic characters or with different scripts.

Things I have tried

Well, I’ve tried using font-size-adjust in a CSS snippet.

image

Current workaround

I’m currently using classes or pseudoclasses with font-size: % . It only works fine if you never change fonts unfortunately.

CSS variables are documented in https://docs.obsidian.md/Reference/CSS+variables/CSS+variables

 

In typography section you will find --font-text-size:


https://docs.obsidian.md/Reference/CSS+variables/Foundations/Typography

Hello! Thank you for your reply. Unfortunately none of these do what I’m looking for. This is an example from my browser, without font-size-adjust:

image

But with the property (font-size-adjust: 0.536):

image

The snippet in obsidianStyle.css was this:

* { font-family: Inter; font-size-adjust: 0.536 !important; }

I’m not talking about variables, I’m talking about CSS properties supported. I guess it’s just not supported?

If you expect font-size-adjust to work and it doesn’t work then you can post to Bug reports . Include also why you cannot use font-size. You can notify here when you have made the post so I can try to reproduce your problem.

Bug reports aren’t usually accepted using custom css, so no need for one at this time.


I don’t have any source text to try with and don’t know what it should look like mixing different languages/characters, but font-size-adjust does have an affect. Make sure you have the latest installer (which includes the latest Electron version that Obsidian is using).

I use a variation of this to set font families for the different view modes. You could give it a try to start. .markdown-source-view > .cm-editor > .cm-scroller is for the editor (source mode and live preview) and .markdown-reading-view > .markdown-preview-view is for reading view.

.markdown-source-view > .cm-editor > .cm-scroller, 
.markdown-reading-view > .markdown-preview-view {
  font-family: "Inter";
  font-size-adjust: 0.536;
}

I’ll move this to Custom CSS & Theme Design for now.

Issue resolved :white_check_mark: Thank you so much!!! For future reference: The solution was uninstalling and re-installing Obsidian. The text in different fonts now usually has the same x-height with font-size-adjust fully functional

image

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.