Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

fix(styles): update definition of FontFace and rename FontFaceStyle #1487

Merged
merged 7 commits into from
Jun 18, 2019

Conversation

layershifter
Copy link
Member

@layershifter layershifter commented Jun 11, 2019

Fixes #1454.

BREAKING CHANGES

Our FontFace definition haven't matched Fela renderFont():

{ name: "Segoe UI Local", style: {} },
// vs
{ name: "Segoe UI Local", props: {} },

So when are passing localAlias it looks that we are passing it to style what it is completely weird:

{ name: "Segoe UI Local", style: { localAlias: 'Segoe UI' } },

Migration

This PR contains:

  • rename of FontFaceStyle to FontFaceProps
  • rename of style to props on FontFace type
-import { FontFaceStyle } from '@stardust-ui/react'
+import { FontFaceProps } from '@stardust-ui/react'
const fontFaces: FontFaces = [
  {
    name: 'Segoe UI',
    paths: [],
-   style: { fontWeight: 400 },
+   props: { fontWeight: 400 },
  },
]

@layershifter layershifter changed the title fix(styles): allow to pass local() to font definition feat(styles): allow to pass local() to font definition Jun 11, 2019
@codecov
Copy link

codecov bot commented Jun 11, 2019

Codecov Report

Merging #1487 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1487   +/-   ##
=======================================
  Coverage   73.25%   73.25%           
=======================================
  Files         825      825           
  Lines        6207     6207           
  Branches     1778     1778           
=======================================
  Hits         4547     4547           
  Misses       1655     1655           
  Partials        5        5
Impacted Files Coverage Δ
packages/react/src/themes/teams/fontFaces.ts 100% <ø> (ø) ⬆️
...ackages/react/src/components/Provider/Provider.tsx 95.34% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0e69305...e6ac857. Read the comment docs.

@layershifter layershifter added ⚙️ enhancement New feature or request and removed 💥 blocked labels Jun 18, 2019
@layershifter layershifter removed the ⚙️ enhancement New feature or request label Jun 18, 2019
@layershifter layershifter changed the title feat(styles): allow to pass local() to font definition fix(styles): update definition of FontFace and rename FontFaceStyle Jun 18, 2019
@layershifter layershifter merged commit 58e0d50 into master Jun 18, 2019
@delete-merged-branch delete-merged-branch bot deleted the fix/fela-fonts-local branch June 18, 2019 15:06
fontStretch?: string
fontStyle?: string
fontVariant?: string
fontWeight?: number
localAlias?: string
localAlias?: string | string[]
Copy link
Member Author

Choose a reason for hiding this comment

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

According to Fela definitions: localAlias?: string | Array<string>

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Not possible to define fontFace with local()
3 participants