-
Notifications
You must be signed in to change notification settings - Fork 16
Remove dependency on Roboto font, and make all components font-agnostic. Enable consumers to have their desired font-family #2673
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
Conversation
|
Documentation has been published to https://lundalogik.github.io/lime-elements/versions/PR-2673/ |
9b23913 to
60f7119
Compare
59d2d65 to
eda590c
Compare
|
The commits individually are not Maybe after the review is done, we should squash all and write this commit message: |
c6e1df6 to
450b220
Compare
I'll have a look-think 😄 |
bb95577 to
f0fcc02
Compare
src/components/date-picker/flatpickr-adapter/flatpickr-adapter.scss
Outdated
Show resolved
Hide resolved
f0fcc02 to
eeb2dfd
Compare
ac373fc to
8f5f29a
Compare
8f5f29a to
968fe8b
Compare
| @use '../../style/mixins'; | ||
|
|
||
| /** | ||
| * @prop --limel-popover-font-family: Font family override for the popover. Because the popover is rendered in a portal, it inherits its font from the body element. If the body's font is not what should be used for the popover, this property can be used to override the font. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this var starts with --limel- prefix, it means this is an internal variable (which is perfect). But that also means we shouldn't add public docs for it, using * @prop. You could say this component itself is private so nobody sees this, but I'd still not do it. It's confusing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this isn't an internal variable. But it has to start with a prefix because it has to be a global variable, so we need the prefix to avoid conflicts with global variables that other libs might provide.
Why are we using --limel- to denote that a variable is internal?
EDIT: Sorry for being passive-aggressive with that question. It doesn't matter why 😄 But it's not great if we want people to be able to use our public variables globally… 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, throughout Lime Elements, we have always used --limel- as a convention for our internal stuff, and when we need public variables, we always use the component's name first, like --popover-xxx-yyy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed this, including the variable itself.
|
|
||
| /** | ||
| * @prop --today-label: Tooltip label for "today". | ||
| * @prop --limel-date-picker-dropdown-font-family: Font family override for the date-picker dropdown. Because the dropdown is rendered in a portal, it inherits its font from the body element. If the body's font is not what should be used for the date-picker, this property can be used to override the font. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one is private prop, but it's publicly documented. See 968fe8b (#2673)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed this variable, and the docs for it.
eb9fddd to
5724134
Compare
| // but still displays the same font as the rest of the components. | ||
| // This is needed, since the popover opens in the Portal, | ||
| // which inherits its font from the root element (Kompendium). | ||
| font-family: var(--kompendium-example-font-family, inherit); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one still needs to be change.
| font-family: var(--kompendium-example-font-family, inherit); | |
| font-family: inherit; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah! I must have missed this one… 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, crap… I made a mistake when I removed my fixup. Never mind, I'll fix it 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚡
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need the font-family: inherit;, as far as I can see. It works correctly without it in the docs at least, and it's what I'd expect, since inherit is the default behaviour anyway, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm… progress-flow uses Arial for some reason… both in next and in this PR…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😮 But that's a unicode. How would this happen? Does it mean that emojis won't show in the web-client neither?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure, but I think this is because that character technically isn't an emoji. I think that emojis are recognised by the system, and always rendered using the same font, but this icon is older than emojis, and therefore the selected font is left in charge of how its rendered. Or something like that anyway.
You have the same with
Char:
Emoji: ❤️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I'm not sure why the character changes between edit mode and read mode, since it looks like the same font is being used in both modes… 🤷♂️)
| * ⚠️ If we change the font stacks, we need to update | ||
| * 1. the consumer documentation in `README.md`, and | ||
| * 2. the CSS variables of `--kompendium-example-font-family` | ||
| * in the `<style>` tag of `index.html`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some fixups that places the addition of parts of this comment in the commits where the things referred to in the comment are introduced. For future traceability.
b612769 to
ace5bb9
Compare
…lt to system font This feature contains the following changes: docs(README.md): explain how font-related styles should be supplied fix(index.html): remove Roboto & set examples to use our default font stack Before this commit, the documentation used to request Roboto be downloaded from Google Fonts. Some components used this font to render their UI, while some inherited their font from Kompendium's body font. Here we set the default font to our cross-browser font stack, and tell all components to render their UI with this font and the specified font-related styles instead. The following commits will make some components free from Roboto. fix(badge): remove dependency on Roboto font fix(banner): remove dependency on Roboto font fix(button): remove dependency on Roboto font fix(breadcrumbs): render divider properly without dependency to chosen font This ensures that the divider character is vertically & horizontally center-aligned. fix(button-group): remove dependency on Roboto font fix(checkbox): remove dependency on Roboto font fix(chip-set): remove dependency on Roboto font fix(code-editor): ensure usage of cross-browser font stack This component was only using `monospace` as `font-family` to render the code. However, we have a `mixin` which offers a better font stack and defaults to more aesthetically pleasing fonts. The font stack has `monospace` as its last fallback. fix(collapsible-section): remove dependency on Roboto font fix(dialog): remove dependency on Roboto font fix(header): ensure optimal rendering of fonts As heading and subheading fonts are now using our font-stack, their `font-weight` had to be adjusted. fix(helper-line): remove dependency on Roboto font chore(style/internal): delete unused "helper-text" mixins Since we started using `limel-helper-line`, these mixins became obsolete. Previously, they were used in all components with the helper-line. fix(input elements): remove dependency on Roboto font From now on these component will inherit its unspecified font-related styles: - input field - select - picker - chipset - slider fix(list, menu): remove dependency on Roboto font fix(select): ensure optimal rendering of fonts As heading is now using our font-stack, its `font-weight` had to be adjusted. fix(select): remove dependency on Roboto font fix(slider): remove dependency on Roboto font fix(snackbar): remove dependency on Roboto font fix(switch): remove dependency on Roboto font fix(tab-bar): remove dependency on Roboto font fix(table): remove dependency on Roboto font fix(form): remove dependency on Roboto font Also, this commit ensures if `lime-typography.scss` has been imported anywhere that we have missed, or couldn't remove, the font-family that are coming from this file would not be automatically set to MDC's font stack. fix(circular-progress): fit in longer values better in `small` & `x-small` sizes
ace5bb9 to
ca91cd1
Compare
|
🎉 This PR is included in version 37.1.0-next.84 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 37.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 37.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |


requires: jgroth/kompendium#130
fixes https://github.com/Lundalogik/crm-feature/issues/3820
Review:
Browsers tested:
(Check any that applies, it's ok to leave boxes unchecked if testing something didn't seem relevant.)
Windows:
Linux:
macOS:
Mobile: