Skip to content

add new typography component#10197

Merged
brad-decker merged 1 commit intodevelopfrom
typography-component
Jan 20, 2021
Merged

add new typography component#10197
brad-decker merged 1 commit intodevelopfrom
typography-component

Conversation

@brad-decker
Copy link
Copy Markdown
Contributor

@brad-decker brad-decker commented Jan 15, 2021

Requires: #10193

Adds a new Typography UI component that will allow quickly styling text per the design system without adding additional class names and scss.

Example: where you might have previously needed to do something like this:

  <div className="my-component">
    <header className="my-component__header">
      <h1>Text</h1>
      <h4>Text</h4>
    </header>
  </div>
.my-component {
  &__header {
    h1 {
     @include H1;

     color: $ui-4;
    }
    h4 {
     @include H4;
   
     color: $ui-2;
    }
  }
}

You can now do:

  <div className="my-component">
    <header>
      <Typography variant={TYPOGRAPHY.H1} color={COLORS.UI4}>Text</Typography>
      <Typography variant={TYPOGRAPHY.H4} color={COLORS.UI2}>Text</Typography>
    </header>
  </div>

The lack of an example scss file for the second one is on purpose... you don't need it!

To an extent, this PR also will do some alignment and positioning for you, behind the spacing and align props. Eventually, I hope to improve the Typography component to hit 90% of the UI use cases without needing to apply a className or custom scss.

Storybook:
storybook

@brad-decker brad-decker changed the base branch from develop to improve-design-system-scss January 15, 2021 20:07
@brad-decker brad-decker force-pushed the improve-design-system-scss branch from 7ac9372 to b7b60c3 Compare January 18, 2021 18:35
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [2bd77ce]
Page Load Metrics (459 ± 41 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint31574584
domContentLoaded3205544588541
load3215554598541
domInteractive3195534588541

@brad-decker brad-decker mentioned this pull request Jan 18, 2021
Base automatically changed from improve-design-system-scss to develop January 19, 2021 16:30
@brad-decker brad-decker force-pushed the typography-component branch 2 times, most recently from 5b8f87f to b6a1c02 Compare January 19, 2021 17:54
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [b6a1c02]
Page Load Metrics (541 ± 55 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint367552105
domContentLoaded33372554011555
load33472654111555
domInteractive33372553911555

@brad-decker brad-decker changed the base branch from develop to add-scss-path January 19, 2021 18:16
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [f5fb0dd]
Page Load Metrics (551 ± 121 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint34614574
domContentLoaded3321575550251121
load3331576551251121
domInteractive3321575550251121

Base automatically changed from add-scss-path to develop January 20, 2021 15:58
@brad-decker brad-decker marked this pull request as ready for review January 20, 2021 15:58
@brad-decker brad-decker requested a review from a team as a code owner January 20, 2021 15:58
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [ada325b]
Page Load Metrics (596 ± 41 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint39705095
domContentLoaded3597025948642
load3607035968641
domInteractive3587025948641

Copy link
Copy Markdown
Contributor

@NiranjanaBinoy NiranjanaBinoy left a comment

Choose a reason for hiding this comment

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

LGTM

@brad-decker brad-decker merged commit 29f4c93 into develop Jan 20, 2021
@brad-decker brad-decker deleted the typography-component branch January 20, 2021 22:13
@github-actions github-actions bot locked and limited conversation to collaborators Jan 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants