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

Change variables without forcing vertical-rhythm #147

Closed
thisischrisj opened this issue Feb 22, 2021 · 1 comment · Fixed by #156
Closed

Change variables without forcing vertical-rhythm #147

thisischrisj opened this issue Feb 22, 2021 · 1 comment · Fixed by #156

Comments

@thisischrisj
Copy link

If $normalize-vertical-rhythm is set to false manually we should be able to change the value of variable without the $normalize-vertical-rhythm being overridden here:

  // If we've customized any font variables, we'll need extra properties.
  @if $base-line-height != 24px
    or $base-unit != 'em'
    or $h2-font-size != 1.5  * $base-font-size
    or $h3-font-size != 1.17 * $base-font-size
    or $h4-font-size != 1    * $base-font-size
    or $h5-font-size != 0.83 * $base-font-size
    or $h6-font-size != 0.67 * $base-font-size {
    $normalize-vertical-rhythm: true !global;
  }

The logic should first detect if $normalize-vertical-rhythm was set by the user and only overwrite it if not. A better default value, therefore, would be null. You could then check against null in the above and only force to true if so. If false, then honour the users choice and don't output.

The checks for @if $normalize-vertical-rhythm { would all still work as intended.

@JohnAlbin
Copy link
Owner

@thisischrisj That's actually really smart.

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 a pull request may close this issue.

2 participants