Miscellaneous
Using System-Appropriate Fonts
Different platforms come with many preinstalled fonts that can be used by your application's UI. For reasonable defaults, we recommend the following cross-browser stacks (as recommended by Tailwind):
While these defaults are great for providing a consistent experience across platforms, you may sometimes wish to prefer a certain font stack on specific platforms. For example, it may be preferable for fonts on Mac devices to load with a priority of -apple-system, ui-sans-serif, system-ui...
.
To handle these cases, ToDesktop adds a todesktop
and a todesktop-platform-[platform]
class to the html element on each page of your app. If you wish to specify a different font priority for Mac, you can do the following:
The html.todesktop
class pre-selector will ensure that the css is only applied when running as a desktop app. For more information on custom CSS in ToDesktop apps, see our detailed guide.
As is common on the web, you can also use the @font-face rule to specify native fonts:
@font-face
rules cannot be declared within a CSS selector, so the following would not work:
Native fonts to be used with the @font-face
rule can be downloaded from the platform provider: