Skip to content

feat: ensure all components inherit font-family #8388

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

Merged
merged 27 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
d4d6cde
feat(font tokens): add fallback fonts to core
alisonailea Dec 9, 2023
a2d20bd
feat(font tokens): add fallback fonts to semantic tokens
alisonailea Dec 9, 2023
bc2c8c9
feat(token transformer): allow font family tokens to output fallbacks
alisonailea Dec 9, 2023
37906ab
fix(calcite-components): should only reference font-family tokens
alisonailea Dec 9, 2023
c93d029
Revert "feat(font tokens): add fallback fonts to core"
alisonailea Dec 9, 2023
6b9cd9a
Revert "feat(font tokens): add fallback fonts to semantic tokens"
alisonailea Dec 9, 2023
8ee543b
Revert "feat(token transformer): allow font family tokens to output f…
alisonailea Dec 9, 2023
11fe265
Merge branch 'main' of github.com:Esri/calcite-components into astump…
alisonailea Feb 28, 2024
73353f8
Merge branch 'main' into astump/7175-font-family
alisonailea Mar 5, 2024
acbbf17
Merge branch 'main' into astump/7175-font-family
alisonailea Mar 19, 2024
9cc1af5
Merge branch 'main' into astump/7175-font-family
alisonailea Mar 19, 2024
eb16f83
Merge branch 'main' into astump/7175-font-family
alisonailea Mar 20, 2024
9a8d74d
feat(font): add avenir next to core fonts
alisonailea Mar 21, 2024
924753c
fix(font): add avenir next font fallback
alisonailea Mar 21, 2024
fe3b5bd
fix(navigation-user): add back font-sans
alisonailea Mar 21, 2024
8fa85f9
fix(list-item): add missing padding
alisonailea Mar 21, 2024
a4e316b
fix(block): add back font-sans
alisonailea Mar 21, 2024
f708f2d
fix(action): add back font-sans
alisonailea Mar 21, 2024
bad7944
test(tokens): update snapshot tests
alisonailea Mar 21, 2024
6e2a4c2
chore(font): add description to font tokens
alisonailea Mar 21, 2024
0b3da78
fix(font): update default font family fallbacks
alisonailea Mar 21, 2024
ea2486f
Merge branch 'main' of github.com:Esri/calcite-components into astump…
alisonailea Mar 21, 2024
25f6cbb
fix(text-area): add back font-sans
alisonailea Mar 21, 2024
1b0bf22
fix(list-area): add back missing styles
alisonailea Mar 21, 2024
aa0099c
fix(block-section): add back font-sans
alisonailea Mar 21, 2024
530cb33
Merge branch 'main' into astump/7175-font-family
jcfranco Apr 23, 2024
e4b26e5
merge main
jcfranco Apr 24, 2024
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
2 changes: 1 addition & 1 deletion packages/calcite-components/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ module.exports = {
closable
kind="warning"
scale="l"
style="font-family: var(--calcite-sans-family)"
style="font-family: var(--calcite-font-family)"
>
<div slot="title">
This storybook is on the current @next version and is meant for internal, testing purposes only.
Expand Down
2 changes: 1 addition & 1 deletion packages/calcite-components/.storybook/preview-head.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<!-- docs fixes for displaying components -->
<style>
body {
font-family: var(--calcite-sans-family);
font-family: var(--calcite-font-family);
color: var(--calcite-color-text-1);
background-color: var(--calcite-color-background);
}
Expand Down
4 changes: 2 additions & 2 deletions packages/calcite-components/calcite-preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ export default {
},
fontFamily: {
// assets/styles/_type
sans: "var(--calcite-sans-family)",
mono: "var(--calcite-code-family)",
sans: "var(--calcite-font-family)",
mono: "var(--calcite-font-family-code)",
inherit: "inherit",
},
fontSize: {
Expand Down
10 changes: 5 additions & 5 deletions packages/calcite-components/src/assets/styles/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@
@extend %type-vars;
@include floating-ui-base();
@include animation-base();

text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
--calcite-popover-z-index: var(--calcite-z-index-popup);
--calcite-border-radius: var(--calcite-border-radius-round, 4px);
--calcite-border-radius-base: 0;
--calcite-offset-invert-focus: 0; // should be 0 or 1
--calcite-panel-width-multiplier: 1;
--calcite-ui-icon-color: currentColor;

@apply font-sans;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;

font-family: var(--calcite-font-family);
}

.calcite-mode-auto {
Expand Down
20 changes: 8 additions & 12 deletions packages/calcite-components/src/components/action/action.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
items-center
justify-start
border-none
font-sans
font-medium;

text-align: unset;
Expand Down Expand Up @@ -159,12 +158,15 @@
@apply text-color-1 fill-color-1 bg-foreground-3;
}

:host([active]) .button:active {
@apply bg-foreground-1;
:host([appearance="transparent"]) .button {
@apply bg-transparent
transition-shadow
duration-150
ease-in-out;
}

:host([appearance="transparent"]) .button {
@apply bg-transparent;
:host([active]) .button:active {
@apply bg-foreground-1;
}

:host([appearance="transparent"][active]) .button,
Expand All @@ -185,6 +187,7 @@
:host([loading][appearance="solid"]) .button:hover,
:host([loading][appearance="solid"]) .button:focus {
@apply bg-foreground-1;

.text-container {
@apply opacity-disabled;
}
Expand All @@ -207,13 +210,6 @@
@apply opacity-disabled bg-foreground-3;
}

:host([appearance="transparent"]) .button {
@apply bg-transparent
transition-shadow
duration-150
ease-in-out;
}

.indicator-with-icon {
@include action-indicator();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,15 @@
w-full
border-0
bg-transparent
font-sans
font-medium;
}

.toggle--switch {
.status-icon {
margin-inline-start: theme("margin.2");
}
}

.toggle--switch,
.section-header {
@apply text-n1
Expand Down Expand Up @@ -72,12 +77,6 @@
}
}

.toggle--switch {
.status-icon {
margin-inline-start: theme("margin.2");
}
}

.toggle--switch__content {
@apply flex flex-auto items-center;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
@include disabled();

.container {
@apply bg-foreground-2 text-n1 text-color-2 m-0 flex flex-1 p-3 font-sans font-bold;
@apply bg-foreground-2 text-n1 text-color-2 m-0 flex flex-1 p-3 font-bold;
}

.heading {
Expand Down
44 changes: 20 additions & 24 deletions packages/calcite-components/src/components/list-item/list-item.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
@apply bg-foreground-1
box-border
flex
flex-1 font-sans;
flex-1;
* {
@apply box-border;
}
Expand Down Expand Up @@ -48,7 +48,6 @@
select-none
flex
flex-auto
font-sans
font-normal
items-stretch
p-0;
Expand All @@ -75,15 +74,6 @@ td:focus {
py-2;
}

.label,
.description,
.content-bottom {
@apply text-n2 word-break font-sans font-normal;
&:only-child {
@apply m-0 py-1;
}
}

.label {
@apply text-color-1;
}
Expand All @@ -92,6 +82,22 @@ td:focus {
@apply text-color-3 mt-0.5;
}

.content-bottom {
@apply bg-foreground-1 flex flex-col;
padding-inline-start: calc(
var(--calcite-list-item-spacing-indent) * var(--calcite-list-item-spacing-indent-multiplier)
);
}

.label,
.description,
.content-bottom {
@apply text-n2 word-break font-normal;
&:only-child {
@apply m-0 py-1;
}
}

.content-start {
@apply justify-start;
}
Expand All @@ -103,13 +109,10 @@ td:focus {
.content-start,
.content-end {
@apply flex-auto;
}

.content-bottom {
@apply bg-foreground-1 flex flex-col;
padding-inline-start: calc(
var(--calcite-list-item-spacing-indent) * var(--calcite-list-item-spacing-indent-multiplier)
);
::slotted(calcite-icon) {
@apply self-center mx-3;
}
}

.content-container--has-center-content .content-start,
Expand Down Expand Up @@ -137,13 +140,6 @@ td:focus {
@apply cursor-pointer;
}

.content-start,
.content-end {
::slotted(calcite-icon) {
@apply self-center mx-3;
}
}

.actions-start,
.actions-end {
::slotted(calcite-action),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
cursor-pointer
transition-default
focus-base
font-sans
text-0h;
border-block-end: 2px solid transparent;
}
Expand All @@ -29,14 +28,6 @@
@apply bg-foreground-3 text-color-1;
}

calcite-avatar {
@apply px-4;
}

calcite-avatar ~ .text-container {
@apply ps-0;
}

:host([active]) .button {
@apply text-color-1 border-color-brand;
--calcite-ui-icon-color: var(--calcite-color-brand);
Expand All @@ -50,6 +41,14 @@ calcite-avatar ~ .text-container {
mt-0.5;
}

calcite-avatar {
@apply px-4;
}

calcite-avatar ~ .text-container {
@apply ps-0;
}

.full-name {
@apply text-0
ms-0
Expand Down
12 changes: 4 additions & 8 deletions packages/calcite-components/src/components/stack/stack.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
@apply text-color-2
flex
flex-auto
font-sans
font-normal
items-stretch;
}
Expand Down Expand Up @@ -45,6 +44,10 @@
.content-start,
.content-end {
@apply flex-initial;

::slotted(calcite-icon) {
@apply self-center mx-3;
}
}

.actions-start,
Expand All @@ -54,13 +57,6 @@
@apply flex items-center;
}

.content-start,
.content-end {
::slotted(calcite-icon) {
@apply self-center mx-3;
}
}

.actions-start,
.actions-end {
::slotted(calcite-action),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ textarea {
box-border
border-color-input
border
font-sans
w-full
m-0;
min-inline-size: theme("spacing.48");
Expand Down Expand Up @@ -86,9 +85,7 @@ textarea {
@apply py-1
px-2;
}
}

:host([scale="s"]) {
textarea,
.footer,
.character-limit {
Expand All @@ -107,9 +104,7 @@ textarea {
px-3;
min-block-size: 2.25rem;
}
}

:host([scale="m"]) {
textarea,
.footer,
.character-limit {
Expand All @@ -129,9 +124,7 @@ textarea {
px-4;
min-block-size: 2.75rem;
}
}

:host([scale="l"]) {
textarea,
.footer,
.character-limit {
Expand Down
2 changes: 1 addition & 1 deletion packages/calcite-components/src/demos/_assets/demos.css
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ main {

.calcite-comp {
color: var(--calcite-color-text-3);
font-family: var(--calcite-sans-family);
font-family: var(--calcite-font-family);
font-size: var(--calcite-font-size-0);
font-weight: var(--calcite-font-weight-medium);
}
2 changes: 1 addition & 1 deletion packages/calcite-components/src/demos/accordion.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
flex: 0 0 20%;
margin: 0 25px;
color: var(--calcite-color-text-3);
font-family: var(--calcite-sans-family);
font-family: var(--calcite-font-family);
font-size: var(--calcite-font-size-0);
font-weight: var(--calcite-font-weight-medium);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/calcite-components/src/demos/action.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
.child-action-bar {
margin: 10px 25px;
color: var(--calcite-color-text-3);
font-family: var(--calcite-sans-family);
font-family: var(--calcite-font-family);
font-size: var(--calcite-font-size-0);
font-weight: var(--calcite-font-weight-medium);
padding: 0 10px;
Expand Down
2 changes: 1 addition & 1 deletion packages/calcite-components/src/demos/alert.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
.first-container,
.second-container > div {
color: var(--calcite-color-text-3);
font-family: var(--calcite-sans-family);
font-family: var(--calcite-font-family);
font-size: var(--calcite-font-size-0);
font-weight: var(--calcite-font-weight-medium);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/calcite-components/src/demos/avatar.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
flex: 1 0 21%;
margin: 0 15px;
color: var(--calcite-color-text-3);
font-family: var(--calcite-sans-family);
font-family: var(--calcite-font-family);
font-size: var(--calcite-font-size-0);
font-weight: var(--calcite-font-weight-medium);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/calcite-components/src/demos/block.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
flex: 0 0 40%;
margin: 0 25px;
color: var(--calcite-color-text-3);
font-family: var(--calcite-sans-family);
font-family: var(--calcite-font-family);
font-size: var(--calcite-font-size-0);
font-weight: var(--calcite-font-weight-medium);
padding: 18px 0;
Expand Down
Loading