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

Add typography variables #482

Merged
merged 9 commits into from
Feb 7, 2022
Merged

Add typography variables #482

merged 9 commits into from
Feb 7, 2022

Conversation

hadasfa
Copy link
Contributor

@hadasfa hadasfa commented Jan 24, 2022

Basic

  • Used plop (npm run plop) to create a new component.
  • PR has description.
  • New component is functional and uses Hooks.
  • Component defines PropTypes.

Style

  • Styles are added to NewComponent.modules.scss file inside of the NewComponent folder.
  • Component uses CSS Modules.
  • Design is compatible with Monday Design System.

Storybook

  • Stories were added to /src/NewComponent/__stories__/NewComponent.stories.js file.
  • Stories include all flows of using the component.

Tests

Hadas Farhi added 5 commits January 24, 2022 15:39
…to css/hadas/typography

� Conflicts:
�	package-lock.json
�	package.json
�	src/components/AttentionBox/AttentionBox.scss
line-height: $line-height-for-size-18;
font-family: var(--font-family);
font-weight: var(--font-weight-normal);
line-height: 21px;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we usually put different padding for 18px and therefore removed the variable

@@ -8,7 +8,6 @@
outline: none;
border: none;
height: auto;
font-family: Roboto, sans-serif;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

because we use mixins for fonts here for each button size which include font family setting

@@ -3,6 +3,9 @@
$avatar-icon-large: 28px;
$avatar-icon-medium: 18px;
$avatar-icon-small: 12px;
$font-size-avatar-large: 18px;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved out of typography because its not the default sizes which in css variables now

@@ -2,7 +2,7 @@

// font family
$header-primary-font: "Sofia Pro", Roboto, sans-serif;
$text-primary-font: Roboto, sans-serif;
$text-primary-font: var(--font-family);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

its ok because we don't want our storybook to be depended at the system font

@hadasfa hadasfa requested a review from orrgottlieb January 25, 2022 12:51
@hadasfa hadasfa changed the title WIP (not ready yet) Add typograpy variables Add typograpy variables Jan 25, 2022
@hadasfa hadasfa changed the title Add typograpy variables Add typography variables Jan 25, 2022
@@ -74,9 +74,9 @@ export const TextStyles = () => {
</VisualDescription>
<VisualDescription
ariaLabel="H5"
title="Fourth heading (Roboto 18px bold)"
title="Fourth heading (Roboto 16px bold)"
Copy link
Contributor

Choose a reason for hiding this comment

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

(might be out of this PR's scope) looks like the details can easily get out of sync with the actual rules (meaning, the rules might change to be Roboto 16px semi-bold, but no one will remember to update this story).
Is there a way to automatically sync between the rules and the stories? perhaps exporting a SASS variable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We exporting the css variables for this exactly. ׳e need to add them to this doc and i will talk with eivgany about the design of the doc with the variables.

@@ -29,129 +9,81 @@ $p-empty-state-height: 16px;
$h6-empty-state-height: 12px;
$small-empty-state-height: 12px;

@mixin base-font {
Copy link
Contributor

Choose a reason for hiding this comment

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

looks like the usage of base-font always comes along with a font rule. What do you think about adding the font rule as an argument to base-font, so that future devs will never forget that this is required?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed, will be fixed

Copy link
Contributor

@laviomri laviomri left a comment

Choose a reason for hiding this comment

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

Cool! had some questions :)

@hadasfa hadasfa merged commit 209799d into master Feb 7, 2022
@hadasfa hadasfa deleted the css/hadas/typography branch February 7, 2022 08:59
@github-actions
Copy link
Contributor

github-actions bot commented Feb 7, 2022

Your PR should include one (and only one) of the following labels:

  • PR: Bugfix 🐛
  • PR: New Feature 🕹
  • PR: Dependencies 🛠
  • PR: Documentation 📖
  • PR: Internal 🏠
  • PR: Breaking Changes 💥
  • PR: Icon 💎

@hadasfa hadasfa restored the css/hadas/typography branch February 8, 2022 09:52
hadasfa pushed a commit that referenced this pull request Feb 8, 2022
hadasfa pushed a commit that referenced this pull request Feb 8, 2022
@hadasfa hadasfa deleted the css/hadas/typography branch February 8, 2022 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants