Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion README.md
Copy link
Contributor

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…

Copy link
Contributor

Choose a reason for hiding this comment

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

This is a pity:

Roboto:
image

This PR on macOS:
image

Definitely not worth loading Roboto for, but still a pity.

Copy link
Contributor Author

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?

Copy link
Contributor

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 ♥️. 👈 That isn't actually an emoji, it's a heart-character that existed before emojis. But once I post this comment that heart-character will look quite similar to the actual heart-emoji that also exists, so I'll post a screenshot of this comment in edit mode too. Notice how the actual emoji doesn't change between edit mode and read mode, while the character does.

Char: ♥️
Emoji: ❤️

image

Copy link
Contributor

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… 🤷‍♂️)

Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,25 @@ For a full list of components, along with live examples, please visit the [docum

#### 1. Font

The "Roboto" font is included for development purposes, but is not included in the published package. This font should be supplied by the consuming application. If not supplied, texts will fall back to suitable alternatives.
To achieve a blazing fast rendering, our components' user interface utilizes a default cross-browser sans-serif font stack. As web components typically inherit font-related styles such as `font-family`, `font-size`, and `color`, we recommend defining these styles at a higher level, such as the `<body>` element. This is because we do not specify these defaults on each individual component.

To maintain consistency with the look & feel demonstrated in this documentation, we suggest incorporating the following styles into your project:

```css
font-family: ui-sans-serif, system-ui, sans-serif;
font-size: 0.875rem;
font-style: normal;
font-weight: 400;
color: rgb(var(--contrast-1500));
```

💡 About the `color` specified above, read more on [our color system](/#/DesignGuidelines/color-system.md/).

Feel free to customize the font-family and related styles to suit your project's needs. For example, you might prefer a different typeface like below:

```css
font-family: 'Roboto', Arial, Verdana, sans-serif;
```

#### 2. Icons

Expand Down
2 changes: 0 additions & 2 deletions src/components/badge/badge.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
@use '../../style/functions';
@use '../../style/internal/lime-theme';
@use '../../style/internal/lime-typography';
@use '../../style/mixins';

/**
Expand All @@ -23,7 +22,6 @@
}

span {
@include lime-typography.base;
cursor: default;
box-sizing: border-box;

Expand Down
2 changes: 0 additions & 2 deletions src/components/banner/banner.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@use '../../style/internal/lime-theme';
@use '../../style/internal/lime-typography';
@use '../../style/internal/variables';
@use '../../style/functions';

Expand All @@ -9,7 +8,6 @@
*/

.lime-banner {
@include lime-typography.typography(body2);
min-height: variables.$lime-banner-height;
display: none;
background-color: rgba(var(--contrast-100), 0.7);
Expand Down
2 changes: 1 addition & 1 deletion src/components/banner/banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class Banner {
<div class="lime-banner__surface">
<div class="lime-banner__content">
{this.renderIcon()}
<div class="mdc-typography--body2">{this.message}</div>
<div>{this.message}</div>
<div class="lime-banner__actions">
<slot name="buttons" />
</div>
Expand Down
4 changes: 4 additions & 0 deletions src/components/breadcrumbs/breadcrumbs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ ol {

&:after {
content: var(--limel-breadcrumbs-divider);
display: flex;
align-items: center;
justify-content: center;

width: var(--limel-breadcrumbs-gap);

position: absolute;
Expand Down
10 changes: 10 additions & 0 deletions src/components/button-group/button-group.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@
* @prop --button-group-background-color: Background color of the component. Defaults to `--contrast-400`
*/

.mdc-chip {
// As long as this component is depended on MDC,
// we need to force it to be font-agnostic.
// When MDC-dependency is removed, this block can also be removed.
// However, on removal of MDC-dependency, we should also make sure to check
// other font-related styles that might be set by MDC,
// such as `letter-spacing` or `font-size`.
font-family: inherit;
}

.mdc-chip {
@include mixins.is-flat-inset-clickable($background-color: transparent);
max-width: 100%;
Expand Down
16 changes: 12 additions & 4 deletions src/components/button/button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@

@include mixins.visualize-aria-expanded('button');

button.mdc-button {
// As long as this component is depended on MDC,
// we need to force it to be font-agnostic.
// When MDC-dependency is removed, this block can also be removed.
// However, on removal of MDC-dependency, we should also make sure to check
// other font-related styles that might be set by MDC,
// such as `letter-spacing` or `font-size`.
font-family: inherit;
}

button {
display: flex;
align-items: center;
Expand Down Expand Up @@ -76,11 +86,9 @@ button {
}

.label {
font-family: Roboto, sans-serif;
font-size: 0.875rem;
font-weight: 500;
letter-spacing: functions.pxToRem(1);
opacity: 1;
font-weight: 600;
letter-spacing: functions.pxToRem(0.5);
padding: 0 0.25rem;
}

Expand Down
1 change: 1 addition & 0 deletions src/components/callout/callout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,5 @@
.heading {
margin: 0;
font-size: 1rem;
font-weight: 600;
}
10 changes: 10 additions & 0 deletions src/components/checkbox/checkbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@
@include checkbox.core-styles;
@include form-field.core-styles;

.mdc-form-field {
// As long as this component is depended on MDC,
// we need to force it to be font-agnostic.
// When MDC-dependency is removed, this block can also be removed.
// However, on removal of MDC-dependency, we should also make sure to check
// other font-related styles that might be set by MDC,
// such as `letter-spacing` or `font-size`.
font-family: inherit;
}

.mdc-form-field {
display: flex;

Expand Down
10 changes: 10 additions & 0 deletions src/components/chip-set/chip-set.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@ $scale-of-remove-chip-x-when-hovered: scale(0.7);
isolation: isolate;
}

.mdc-chip {
// As long as this component is depended on MDC,
// we need to force it to be font-agnostic.
// When MDC-dependency is removed, this block can also be removed.
// However, on removal of MDC-dependency, we should also make sure to check
// other font-related styles that might be set by MDC,
// such as `letter-spacing` or `font-size`.
font-family: inherit;
}

.mdc-chip {
@include mixins.is-elevated-inset-clickable();
max-width: 100%;
Expand Down
8 changes: 8 additions & 0 deletions src/components/circular-progress/circular-progress.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,19 @@
:host([size='x-small']) {
--circular-progress-size: 1.5rem;
font-weight: bold;

.value {
letter-spacing: functions.pxToRem(-1);
}
}

:host([size='small']) {
--circular-progress-size: 2rem;
font-weight: bold;

.value {
letter-spacing: functions.pxToRem(-0.5);
}
}

:host([size='medium']) {
Expand Down
5 changes: 3 additions & 2 deletions src/components/code-editor/code-editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

/**
* @prop --code-editor-max-height: Defines how tall the code editor can get before content becomes scrollable, defaults to `10rem`.
* @prop --code-editor-font-size: Defines the font size of the code, defaults to `0.875rem`.
* @prop --code-editor-font-size: Defines the font size of the code, defaults to `0.8125rem`.
*/

@mixin light-mode-styles {
Expand Down Expand Up @@ -122,7 +122,7 @@

:host {
display: flex;
font-size: var(--code-editor-font-size, 0.875rem); // 14px
font-size: var(--code-editor-font-size, 0.8125rem); // 13px
@include light-mode-styles;
}

Expand All @@ -148,6 +148,7 @@

.cm-s-lime {
&.CodeMirror {
@include mixins.font-family(monospace);
color: rgb(var(--code-editor-neutral-text-color));
background-color: rgb(var(--code-editor-background-color));
border-radius: 0.25rem;
Expand Down
4 changes: 2 additions & 2 deletions src/components/collapsible-section/collapsible-section.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@use '../../style/internal/lime-theme';
@use '../../style/internal/lime-typography';
@use '../../style/mixins';

/**
Expand Down Expand Up @@ -84,7 +83,8 @@ header {
}

.title {
@include lime-typography.typography(headline2);
font-size: 1rem;
font-weight: 300;
color: var(--mdc-theme-on-surface);

justify-self: flex-start;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

* {
box-sizing: border-box;
font-family: 'Roboto';
}
}

Expand Down
10 changes: 10 additions & 0 deletions src/components/dialog/dialog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ $responsive-body-padding: 3vw; // 3% of viewport's width

@include dialog.core-styles;

.mdc-dialog__content {
// As long as this component is depended on MDC,
// we need to force it to be font-agnostic.
// When MDC-dependency is removed, this block can also be removed.
// However, on removal of MDC-dependency, we should also make sure to check
// other font-related styles that might be set by MDC,
// such as `letter-spacing` or `font-size`.
font-family: inherit;
}

.mdc-dialog {
@include dialog.max-width(16000px, dialog.$margin);

Expand Down
1 change: 0 additions & 1 deletion src/components/form/examples/map-component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
color: rgb(var(--contrast-1100));

font-size: 0.875rem;
font-family: 'Roboto';
}

iframe {
Expand Down
3 changes: 2 additions & 1 deletion src/components/header/header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,13 @@
.heading {
color: var(--header-heading-color, rgb(var(--contrast-1100)));
font-size: functions.pxToRem(17);
font-weight: 500;
}

.subheading {
color: var(--header-subheading-color, rgb(var(--contrast-900)));
font-size: functions.pxToRem(14);
font-weight: lighter;
font-weight: 400;
}

.subheading__supporting-text {
Expand Down
4 changes: 0 additions & 4 deletions src/components/helper-line/helper-line.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@

min-width: 0; // prevents overflowing, if component is placed in flex containers

font-family: Roboto, sans-serif;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
font-size: 0.6875rem;
font-weight: 400;
letter-spacing: 0.0333333333em; // keeping this for now for consistency, until we get rid of all of them
line-height: normal;

color: rgb(var(--contrast-1200));
}
Expand Down
11 changes: 11 additions & 0 deletions src/components/list/list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@ $list-mdc-list-item: 0;

@include list.deprecated-core-styles;

.mdc-deprecated-list,
.mdc-deprecated-list-item__secondary-text {
// As long as this component is depended on MDC,
// we need to force it to be font-agnostic.
// When MDC-dependency is removed, this block can also be removed.
// However, on removal of MDC-dependency, we should also make sure to check
// other font-related styles that might be set by MDC,
// such as `letter-spacing` or `font-size`.
font-family: inherit;
}

.mdc-deprecated-list {
--mdc-theme-text-icon-on-background: var(
--icon-color,
Expand Down
4 changes: 4 additions & 0 deletions src/components/portal/portal.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/**
* @prop --limel-portal-font-family: Font family override for the portal. Because the portal is a direct descendant of the body element, any component placed in the portal inherits its font from the body element. If the body's font is not what should be used for the component in the portal, this property can be used to override the font.
*/

:host(limel-portal) {
display: block;
position: absolute;
Expand Down
2 changes: 2 additions & 0 deletions src/components/portal/portal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ export class Portal {
this.container = document.createElement('div');
this.container.setAttribute('id', this.containerId);
this.container.setAttribute('class', 'limel-portal--container');
this.container.style.fontFamily =
'var(--limel-portal-font-family, inherit)';
Object.assign(this.container, {
portalSource: this.host,
});
Expand Down
12 changes: 12 additions & 0 deletions src/components/select/select.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@
left: functions.pxToRem(16);
}

.mdc-select__anchor,
.mdc-floating-label,
.mdc-select__selected-text {
// As long as this component is depended on MDC,
// we need to force it to be font-agnostic.
// When MDC-dependency is removed, this block can also be removed.
// However, on removal of MDC-dependency, we should also make sure to check
// other font-related styles that might be set by MDC,
// such as `letter-spacing` or `font-size`.
font-family: inherit;
}

.mdc-select__dropdown-icon-graphic {
transition: transform 0.2s ease;
}
Expand Down
11 changes: 11 additions & 0 deletions src/components/slider/slider.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@
margin-top: functions.pxToRem(4);
}

.mdc-floating-label,
.mdc-slider .mdc-slider__value-indicator-text {
// As long as this component is depended on MDC,
// we need to force it to be font-agnostic.
// When MDC-dependency is removed, this block can also be removed.
// However, on removal of MDC-dependency, we should also make sure to check
// other font-related styles that might be set by MDC,
// such as `letter-spacing` or `font-size`.
font-family: inherit;
}

.slider__label {
padding-left: functions.pxToRem(20);
top: functions.pxToRem(
Expand Down
10 changes: 10 additions & 0 deletions src/components/snackbar/snackbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@
gap: 0.75rem;
}

.mdc-snackbar__label {
// As long as this component is depended on MDC,
// we need to force it to be font-agnostic.
// When MDC-dependency is removed, this block can also be removed.
// However, on removal of MDC-dependency, we should also make sure to check
// other font-related styles that might be set by MDC,
// such as `letter-spacing` or `font-size`.
font-family: inherit;
}

.mdc-snackbar__label {
color: rgb(var(--contrast-100));
}
Expand Down
10 changes: 10 additions & 0 deletions src/components/switch/switch.scss
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,16 @@ label {
}
}

label {
// As long as this component is depended on MDC,
// we need to force it to be font-agnostic.
// When MDC-dependency is removed, this block can also be removed.
// However, on removal of MDC-dependency, we should also make sure to check
// other font-related styles that might be set by MDC,
// such as `letter-spacing` or `font-size`.
font-family: inherit;
}

.mdc-switch {
&.mdc-switch--selected,
&.mdc-switch.mdc-switch--unselected {
Expand Down
Loading