Skip to content
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

theme: fix font weight type issue #19366

Closed
wants to merge 1 commit into from
Closed

theme: fix font weight type issue #19366

wants to merge 1 commit into from

Conversation

Rugvip
Copy link
Member

@Rugvip Rugvip commented Aug 14, 2023

Hey, I just made a Pull Request!

Fixes an issue where a bad combination of dependency versions causes font weight from the theme to not be usable as styles. See #19364 and #19255

Should help smooth out MUI v5 migration as you'd often hit this when migrating to v5. #7094

✔️ Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)
  • All your commits have a Signed-off-by line in the message. (more info)

@Rugvip Rugvip requested review from backstage-service and a team as code owners August 14, 2023 16:30
@Rugvip Rugvip requested a review from freben August 14, 2023 16:30
@backstage-goalie
Copy link
Contributor

backstage-goalie bot commented Aug 14, 2023

Missing Changesets

The following package(s) are changed by this PR but do not have a changeset:

  • @backstage/core-components

See CONTRIBUTING.md for more information about how to add changesets.

Changed Packages

Package Name Package Path Changeset Bump Current Version
@backstage/core-components packages/core-components none v0.13.5-next.0
@backstage/theme packages/theme patch v0.4.1

@Rugvip
Copy link
Member Author

Rugvip commented Aug 14, 2023

CC @awanlin @tudi2d since you've been in this area x)

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Copy link
Member

@adamdmharvey adamdmharvey left a comment

Choose a reason for hiding this comment

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

Ah very nice catch. Yeah I discovered in one component if I did this it passed type checking, so spot on!! :)

 label: {
       textTransform: 'uppercase',
-       fontWeight: theme.typography.fontWeightBold,
+       //fontWeight: theme.typography.fontWeightBold,
       letterSpacing: 1.2,
     },

Comment on lines +109 to +112
// This fixes as type incompatibility that is caused by a variance in the declaration of
// the font weight types in the MUI v4 theme typography and styles such as through `makeStyles()`.
// The font weight in styles are defined to be `CSSProperties["fontWeight"]` from `csstype`, while the
// front weight in the typography are defined to be `React.CSSProperties["fontWeight"]` from `@types/react`.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// This fixes as type incompatibility that is caused by a variance in the declaration of
// the font weight types in the MUI v4 theme typography and styles such as through `makeStyles()`.
// The font weight in styles are defined to be `CSSProperties["fontWeight"]` from `csstype`, while the
// front weight in the typography are defined to be `React.CSSProperties["fontWeight"]` from `@types/react`.
// This fixes a type incompatibility that is caused by a variance in the declaration of
// the font weight types in the MUI v4 theme typography and styles such as through `makeStyles()`.
// The font weight in styles are defined to be `CSSProperties["fontWeight"]` from `csstype`, while the
// font weight in the typography are defined to be `React.CSSProperties["fontWeight"]` from `@types/react`.

@github-actions
Copy link
Contributor

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

@github-actions github-actions bot added the stale label Aug 22, 2023
@github-actions github-actions bot closed this Aug 27, 2023
@awanlin
Copy link
Collaborator

awanlin commented Aug 28, 2023

@Rugvip, did you mean for this to close?

@Rugvip Rugvip reopened this Aug 28, 2023
@Rugvip Rugvip requested a review from a team as a code owner August 28, 2023 12:33
@Rugvip Rugvip requested a review from tudi2d August 28, 2023 12:33
@github-actions github-actions bot removed the stale label Aug 28, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Sep 4, 2023

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

@github-actions github-actions bot added the stale label Sep 4, 2023
@Rugvip Rugvip removed the stale label Sep 5, 2023
@github-actions
Copy link
Contributor

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

@github-actions github-actions bot added the stale label Sep 12, 2023
@Rugvip Rugvip removed the stale label Sep 12, 2023
@github-actions
Copy link
Contributor

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

@github-actions github-actions bot added stale and removed stale labels Sep 19, 2023
@github-actions
Copy link
Contributor

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

@github-actions github-actions bot added the stale label Sep 27, 2023
@github-actions github-actions bot closed this Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants