Skip to content

Conversation

@warm-coolguy
Copy link
Member

@warm-coolguy warm-coolguy commented Jan 19, 2026

Summary

Allow fontFamily configuration for map client.

Instructions for local reproduction and review

I've added modified a snippet the dataportTheme in the snowbox that can be uncommented to check the results in it. I suggest trying 'Consolas', since it's easily distinguishable, and '', since it has a special meaning. When using '', set e.g. font-family: Book Antiqua; on the POLAR host node in the DOM manipulator to check whether it works as expected.

I'm currently having an issue with vite and couldn't check the build. Please verify that the fonts are bundled separately to the other .css files so that they can only optionally be imported during run-time.

Pull Request Checklist (for Assignee)

  • Changelogs are maintained
  • Functionality has been tested in Firefox, Chrome, Safari (Please verify in Safari!)
  • Functionality has been tested on a smartphone
  • Functionality has been tested with 200% screen zoom
  • Screenreader functionality has been manually tested with NVDA

UI has been tested in the following tools regarding accessibility (only regarding functionality affected in this PR)

  • Chrome Lighthouse
  • Firefox Accessibility

Relevant tickets, issues, et cetera

@warm-coolguy warm-coolguy self-assigned this Jan 19, 2026
@warm-coolguy warm-coolguy added the enhancement New feature or request label Jan 19, 2026
@github-actions
Copy link

github-actions bot commented Jan 19, 2026

PR Preview Action v1.8.0

QR code for preview link

🚀 View preview at
https://Dataport.github.io/polar/pr-preview/pr-483/

Built to branch gh-pages at 2026-01-28 06:31 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@oeninghe-dataport oeninghe-dataport removed the request for review from dopenguin January 20, 2026 09:27
Copy link
Collaborator

@oeninghe-dataport oeninghe-dataport left a comment

Choose a reason for hiding this comment

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

Comment on lines 51 to 53
if (typeof mapConfiguration.fontFamily !== 'undefined') {
void import('@kern-ux/native/dist/fonts/fira-sans.css')
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

If we move the import here, we require the usage of this function (which is not used in iceberg, for example).

Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe, a suitable option would be loading the font in loadKern using document.adoptedStyleSheets?

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've got to move it, move it.

kernSheet.replaceSync(`
@layer kern-ux {
${kernCss.replaceAll(':root', ':host')}
${typeof fontFamily !== 'undefined' ? `:host { --kern-typography-font-family-default: ${fontFamily}; }` : ''}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this a separate parameter? Couldn't this be done using theme? (theme allows overriding arbitrary KERN variables, although the type probably needs to be adjusted.)

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've got to move it, move it.

@warm-coolguy warm-coolguy force-pushed the feature/make-font-family-selectable branch 3 times, most recently from fa02f29 to 1484d11 Compare January 28, 2026 06:28
@warm-coolguy warm-coolguy force-pushed the feature/make-font-family-selectable branch from 1484d11 to d7a5170 Compare January 28, 2026 06:28
@warm-coolguy
Copy link
Member Author

🏓 @warm-coolguy

🏓 @oeninghe-dataport I have ... MOVED IT.

Copy link
Collaborator

@oeninghe-dataport oeninghe-dataport left a comment

Choose a reason for hiding this comment

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

@warm-coolguy warm-coolguy merged commit 5d49b77 into next Jan 28, 2026
4 checks passed
@warm-coolguy warm-coolguy deleted the feature/make-font-family-selectable branch January 28, 2026 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants