Skip to content

Commit

Permalink
feat: use Graphik as primary font family
Browse files Browse the repository at this point in the history
  • Loading branch information
anniehu4 committed May 27, 2022
1 parent 233975e commit e8b30d5
Show file tree
Hide file tree
Showing 31 changed files with 85 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .storybook/data/tokens.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
"eds-size-half": "0.25rem",
"eds-size-1-and-half": "0.75rem",
"eds-size-2-and-half": "1.25rem",
"eds-font-family-primary": "'Arimo', sans-serif",
"eds-font-family-primary": "'Graphik', sans-serif",
"eds-font-family-secondary": "'Open Sans', sans-serif",
"eds-font-size-11": "0.688rem",
"eds-font-size-12": "0.75rem",
Expand Down
8 changes: 8 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
const path = require('path');
const SVGSpritemapPlugin = require('svg-spritemap-webpack-plugin');

/**
* Although `--static-dir` is marked as deprecated. The The Chromatic CLI
* currently pulls the staticDir from the build script, but does not support
* the staticDirs configuration option.
*
* We should refrain from using the staticDirs option in this configuration until
* https://github.com/chromaui/chromatic-cli/issues/462 is resolved.
*/
module.exports = {
stories: [
'./components/**/*.stories.@(js|jsx|ts|tsx)',
Expand Down
1 change: 1 addition & 0 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import '../src/design-tokens/css/base/media.css';

// Import theme tokens
import '../src/tokens-dist/css/variables.css';
import '../src/design-tokens/tier-1-definitions/fonts.css';

// Import storybook-specific CSS
import './css/styleguide-only.css';
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@
"build:tokens": "rm -rf src/tokens-dist/ && node ./style-dictionary.config.js",
"build:icons": "svg-sprite-generate -d src/icons/ -o src/icons/spritemap/spritemap.svg && yarn generate-icon-types",
"build:js": "tsc --project tsconfig.build.json",
"build:storybook": "build-storybook -o storybook-static",
"build:storybook": "build-storybook -o storybook-static -s src/design-tokens/tier-1-definitions/fonts",
"build:styles": "postcss \"src/components/**/*.css\" --dir lib/ --base src/ --verbose",
"chromatic": "chromatic",
"commit": "./node_modules/.bin/cz",
"copy-to-lib": "yarn copy-icons-to-lib && yarn copy-tokens-to-lib",
"copy-to-lib": "yarn copy-icons-to-lib && yarn copy-tokens-to-lib && yarn copy-fonts-to-lib",
"copy-fonts-to-lib": "copyfiles -u 3 src/design-tokens/tier-1-definitions/fonts.css src/design-tokens/tier-1-definitions/fonts/**/* lib/tokens",
"copy-icons-to-lib": "copyfiles -u 1 src/icons/spritemap/**/* lib",
"copy-tokens-to-lib": "copyfiles -u 2 src/tokens-dist/**/* lib/tokens",
"create-component": "plop",
Expand All @@ -50,7 +51,7 @@
"release:patch": "yarn build && standard-version --release-as patch",
"release:alpha": "yarn build && standard-version --prerelease alpha",
"start": "yarn build:tokens && yarn storybook",
"storybook": "start-storybook -p 9009 -s public",
"storybook": "start-storybook -p 9009 -s src/design-tokens/tier-1-definitions/fonts",
"storybook:axe": "yarn run build:storybook && yarn run storybook:axeOnly",
"storybook:axeOnly": "axe-storybook --build-dir storybook-static",
"plop": "plop component",
Expand Down
4 changes: 1 addition & 3 deletions src/components/CheckboxLabel/CheckboxLabel.module.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
@import '../../design-tokens/mixins.css';


/*------------------------------------*\
#CHECKBOX LABEL
\*------------------------------------*/
Expand All @@ -22,7 +21,7 @@
}

.label--md {
@mixin eds-theme-typography-label-md;
@mixin eds-theme-typography-label-md-subtle;
line-height: var(--checkbox-svg-size); /* 1 */
}

Expand All @@ -32,4 +31,3 @@
.label--disabled {
color: var(--eds-theme-color-text-disabled);
}

3 changes: 3 additions & 0 deletions src/components/OverflowList/OverflowList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ export const OverflowList = ({ className, children, ...other }: Props) => {
className={styles['overflow-list__inner']}
onScroll={handleOnScroll}
ref={overflowListInnerRef}
// TODO: add correct aria role for overflow list
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
tabIndex={0}
>
{children}
</ul>
Expand Down
1 change: 0 additions & 1 deletion src/design-tokens/css/base/body.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@import '../../mixins.css';
@import '../../../styles/arimo.css';

body {
@mixin eds-theme-typography-body-text-md;
Expand Down
41 changes: 41 additions & 0 deletions src/design-tokens/tier-1-definitions/fonts.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
@font-face {
font-family: 'Graphik';
font-weight: 400;
font-style: normal;
src: url('./fonts/Graphik-Regular-Web.woff2') format('woff2');
}

@font-face {
font-family: 'Graphik';
font-weight: 400;
font-style: italic;
src: url('./fonts/Graphik-RegularItalic-Web.woff2') format('woff2');
}

@font-face {
font-family: 'Graphik';
font-weight: 500;
font-style: normal;
src: url('./fonts/Graphik-Medium-Web.woff2') format('woff2');
}

@font-face {
font-family: 'Graphik';
font-weight: 500;
font-style: italic;
src: url('./fonts/Graphik-MediumItalic-Web.woff2') format('woff2');
}

@font-face {
font-family: 'Graphik';
font-weight: 600;
font-style: normal;
src: url('./fonts/Graphik-Semibold-Web.woff2') format('woff2');
}

@font-face {
font-family: 'Graphik';
font-weight: 600;
font-style: italic;
src: url('./fonts/Graphik-SemiboldItalic-Web.woff2') format('woff2');
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
16 changes: 13 additions & 3 deletions src/design-tokens/tier-1-definitions/typography-presets.css
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ should be reflected in the TypographyPresets story */
}

/**
* Typography Preset 004: Medium & Bold
* Typography Preset 004: Medium, Light, & Bold
*/
@define-mixin eds-typography-preset-004 $important {
font-family: var(--eds-font-family-primary) $important;
Expand All @@ -71,6 +71,11 @@ should be reflected in the TypographyPresets story */
line-height: 1.333 $important;
}

@define-mixin eds-typography-preset-004-light $important {
@mixin eds-typography-preset-004 $important;
font-weight: var(--eds-font-weight-light) $important;
}

@define-mixin eds-typography-preset-004-bold $important {
@mixin eds-typography-preset-004 $important;
font-weight: var(--eds-font-weight-bold) $important;
Expand All @@ -97,15 +102,20 @@ should be reflected in the TypographyPresets story */
}

/**
* Typography Preset 006: Light & Bold
* Typography Preset 006: Medium, Light, & Bold
*/
@define-mixin eds-typography-preset-006 $important {
font-family: var(--eds-font-family-primary) $important;
font-weight: var(--eds-font-weight-light) $important;
font-weight: var(--eds-font-weight-medium) $important;
font-size: var(--eds-font-size-14) $important;
line-height: 1.57 $important;
}

@define-mixin eds-typography-preset-006-light $important {
@mixin eds-typography-preset-006 $important;
font-weight: var(--eds-font-weight-light) $important;
}

@define-mixin eds-typography-preset-006-bold $important {
@mixin eds-typography-preset-006 $important;
font-weight: var(--eds-font-weight-bold) $important;
Expand Down
2 changes: 1 addition & 1 deletion src/design-tokens/tier-1-definitions/typography.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"eds": {
"font-family": {
"primary": {
"value": "'Arimo', sans-serif"
"value": "'Graphik', sans-serif"
},
"secondary": {
"value": "'Open Sans', sans-serif"
Expand Down
18 changes: 9 additions & 9 deletions src/design-tokens/tier-2-usage/typography-usage.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,23 @@
}

@define-mixin eds-theme-typography-body-text-lg $important {
@mixin eds-typography-preset-004 $important;
@mixin eds-typography-preset-004-light $important;
}

@define-mixin eds-theme-typography-body-text-md $important {
@mixin eds-typography-preset-005-light $important;
}

@define-mixin eds-theme-typography-body-text-sm $important {
@mixin eds-typography-preset-006 $important;
@mixin eds-typography-preset-006-light $important;
}

@define-mixin eds-theme-typography-body-text-xs $important {
@mixin eds-typography-preset-008 $important;
}

@define-mixin eds-theme-typography-caption-text-lg $important {
@mixin eds-typography-preset-006 $important;
@mixin eds-typography-preset-006-light $important;
}

@define-mixin eds-theme-typography-caption-text-md $important {
Expand All @@ -65,27 +65,27 @@
}

@define-mixin eds-theme-typography-button-label $important {
@mixin eds-typography-preset-006-bold $important;
@mixin eds-typography-preset-006 $important;
}

@define-mixin eds-theme-typography-form-label $important {
@mixin eds-typography-preset-006-bold $important;
@mixin eds-typography-preset-006 $important;
}

@define-mixin eds-theme-typography-form-input $important {
@mixin eds-typography-preset-005 $important;
@mixin eds-typography-preset-005-light $important;
}

@define-mixin eds-theme-typography-kicker $important {
@mixin eds-typography-preset-011-bold $important;
@mixin eds-typography-preset-011 $important;
}

@define-mixin eds-theme-typography-kicker-sm $important {
@mixin eds-typography-preset-012-bold $important;
@mixin eds-typography-preset-012 $important;
}

@define-mixin eds-theme-typography-tag $important {
@mixin eds-typography-preset-009-bold $important;
@mixin eds-typography-preset-009 $important;
}

/* Old / legacy heading sizes */
Expand Down
Binary file removed src/fonts/open-sans-v16-latin-300.woff
Binary file not shown.
Binary file removed src/fonts/open-sans-v16-latin-300.woff2
Binary file not shown.
Binary file removed src/fonts/open-sans-v16-latin-600.woff
Binary file not shown.
Binary file removed src/fonts/open-sans-v16-latin-600.woff2
Binary file not shown.
Binary file removed src/fonts/open-sans-v16-latin-700.woff
Binary file not shown.
Binary file removed src/fonts/open-sans-v16-latin-700.woff2
Binary file not shown.
Binary file removed src/fonts/open-sans-v16-latin-italic.woff
Binary file not shown.
Binary file removed src/fonts/open-sans-v16-latin-italic.woff2
Binary file not shown.
Binary file removed src/fonts/open-sans-v16-latin-regular.woff
Binary file not shown.
Binary file removed src/fonts/open-sans-v16-latin-regular.woff2
Binary file not shown.
1 change: 0 additions & 1 deletion src/styles/arimo.css

This file was deleted.

2 changes: 1 addition & 1 deletion src/tokens-dist/css/variables.css
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
--eds-size-half: 0.25rem;
--eds-size-1-and-half: 0.75rem;
--eds-size-2-and-half: 1.25rem;
--eds-font-family-primary: 'Arimo', sans-serif;
--eds-font-family-primary: 'Graphik', sans-serif;
--eds-font-family-secondary: 'Open Sans', sans-serif;
--eds-font-size-11: 0.688rem;
--eds-font-size-12: 0.75rem;
Expand Down
2 changes: 1 addition & 1 deletion src/tokens-dist/json/variables-nested.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
"2-and-half": "1.25rem"
},
"font-family": {
"primary": "'Arimo', sans-serif",
"primary": "'Graphik', sans-serif",
"secondary": "'Open Sans', sans-serif"
},
"font-size": {
Expand Down
2 changes: 1 addition & 1 deletion src/tokens-dist/scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ $eds-size-base-unit: 0.5rem !default;
$eds-size-half: 0.25rem !default;
$eds-size-1-and-half: 0.75rem !default;
$eds-size-2-and-half: 1.25rem !default;
$eds-font-family-primary: 'Arimo', sans-serif !default;
$eds-font-family-primary: 'Graphik', sans-serif !default;
$eds-font-family-secondary: 'Open Sans', sans-serif !default;
$eds-font-size-11: 0.688rem !default;
$eds-font-size-12: 0.75rem !default;
Expand Down

0 comments on commit e8b30d5

Please sign in to comment.