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

Fluid type scale #216

Open
wants to merge 13 commits into
base: prod
Choose a base branch
from
Open

Fluid type scale #216

wants to merge 13 commits into from

Conversation

codeAbul
Copy link
Contributor

@codeAbul codeAbul commented Jun 13, 2020

  • Creates a fluid type scale.
  • Provides a convenient config map and a mix-in to programatically generate all the css custom properties required for creating and using a type scale. The methods employed are inspired the following sources( https://every-layout.dev/rudiments/modular-scale/ ). Thanks to @tbrasington and @ovlb for the help and inspiration!
  • Replaced all 'raw' font-sizes with fluid scales. Please let me know if the scales need more refining

Further improvements possible:

  • add clamps for every fontsize used ( need to decide with the help of a designer )
  • Create scales for line-height too

@tatianamac
Copy link
Collaborator

Thank you so much for all your work on this, @codeAbul ! 🎉

@tatianamac tatianamac linked an issue Jun 13, 2020 that may be closed by this pull request
@tatianamac
Copy link
Collaborator

Closes #47.

@codeAbul
Copy link
Contributor Author

Thank you @tbrasington for the updates to line-height and refining scales!

@tatianamac tatianamac requested a review from ovlb June 16, 2020 22:00
@tatianamac
Copy link
Collaborator

@ovlb Feel free to approve this if you and @tbrasington are good with it!

@ovlb
Copy link
Collaborator

ovlb commented Jun 17, 2020

@codeAbul FYI: I already had a look and overall it looks fine. I’ll write a review that’s worthy of your effort tomorrow, promised!

@tbrasington
Copy link

The foundation is solid and in a good place to be extended it as the new features get built out.

As a side note, what may be needed next is guides on pairings of steps and styles.

Copy link
Collaborator

@ovlb ovlb left a comment

Choose a reason for hiding this comment

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

Hey,

Overall this looks good and especially on mobile increases readability. There are some steps we can take to clean up the code before we merge this in. :)

@@ -1,7 +1,10 @@
@import 'typography';
Copy link
Collaborator

Choose a reason for hiding this comment

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

We import this in css/base.scss, I think you were adding this here because otherwise the SASS variables you are defining in the typography partial would not be accessible?

Two ways to mitigate this, both cleaning up the structure a bit:

  • Define the SASS variables in abstracts/variables (or in base/_fonts where the font weights and families are defined)
  • Change the SASS variables to custom properties and define them in base/custom-properties

body {
border-top: 1rem solid $primary-color;
font-family: $sans-serif;
font-size: pxToRem(20);
font-size: var(--step0);
line-height: $line-height-heading;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why are you adding $line-height-heading to the body element? I see that you are overwriting this in multiple places down below. I would propose adding $line-height-body here (because it’s the body) and delete all places were you are setting $line-height-body on other elements. Headlines etc. can still have the deviating line-height. This way we let the cascade of CSS work for us.

Suggested change
line-height: $line-height-heading;
line-height: $line-height-body;

Comment on lines +12 to +13
// number of positive steps (--step1, --step2 etc)
// and number of negative steps (--step-1, --step-2 etc)
Copy link
Collaborator

Choose a reason for hiding this comment

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

These names are not really clear. Hyphenating is common to separate words, especially in CSS where we don’t use camel case. Can you change these two be either --step-pos-1 and --step-neg-1 or for positive use --step-1 (as this is what we mostly use) and only namespace the negative variables, e.g. --step-minus-1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree. Will update

letter-spacing: 0.1;
margin: .75rem 0;
font-family: $ext-sans;
font-size: var(--step0);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe step-0 is not the correct value here, as .sub-headline should be larger then the body text.

@@ -31,17 +31,18 @@

& > p {
font-family: $sans-serif;
font-size: 1.5rem;
font-size: var(--step0);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you changed this here because 1.5rem made the first paragraph in definition mostly unreadable on mobile?

@codeAbul
Copy link
Contributor Author

@ovlb Thank you for the reviews. I shall address them this weekend. Sorry, been busy with stuff! Thanks again

@ovlb
Copy link
Collaborator

ovlb commented Jun 25, 2020

@codeAbul Your pace is the right pace :) Looking forward to your updates!

@tatianamac
Copy link
Collaborator

@codeAbul Checking in to see if you're still interested and able to close out this PR. As far as I can tell we're very close!

@codeAbul
Copy link
Contributor Author

Hi @tatianamac i am so sorry I have left this out in the wind , thanks to the mess of pandemic and job change. I will work on this tonight. Again sorry for the delay. Hope you and yours are keeping well, as well as one can be in these times.

@tatianamac
Copy link
Collaborator

@codeAbul : Hello! A no-pressure check to see how you're feeling about this PR (I'm going through all issues). Are you still interested in finishing it out? (It might very well be finished; it's hard for me to tell for certain).

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

Successfully merging this pull request may close these issues.

🔡 Develop more fluid type system
4 participants