Skip to content

Instantly share code, notes, and snippets.

@aduth
Created October 15, 2020 14:07
Show Gist options
  • Save aduth/77c4d3785666088282cee22f37acd981 to your computer and use it in GitHub Desktop.
Save aduth/77c4d3785666088282cee22f37acd981 to your computer and use it in GitHub Desktop.
lg-3187-revert-uswds-2-2-0-line-height
diff --git a/src/scss/styles.scss b/src/scss/styles.scss
index 5c96614..fc53010 100644
--- a/src/scss/styles.scss
+++ b/src/scss/styles.scss
@@ -8,7 +8,62 @@
@import 'uswds-theme/utilities';
@import 'uswds-theme/components';
-@import 'uswds';
+@import "../../node_modules/uswds/dist/scss/settings/settings-general";
+@import "../../node_modules/uswds/dist/scss/settings/settings-typography";
+@import "../../node_modules/uswds/dist/scss/settings/settings-color";
+@import "../../node_modules/uswds/dist/scss/settings/settings-spacing";
+@import "../../node_modules/uswds/dist/scss/settings/settings-utilities";
+@import "../../node_modules/uswds/dist/scss/settings/settings-components";
+@import "../../node_modules/uswds/dist/scss/core/functions";
+@function px-to-rem($pixels) {
+ @if not $pixels {
+ @return false;
+ }
+ $px-to-rem: ($pixels / $root-font-size-equiv) * 1rem;
+
+ @return $px-to-rem;
+}
+@function lh($props...) {
+ $props: unpack($props);
+ @if not length($props) == 2 {
+ @error 'lh() needs both a valid face and line height token '
+ + 'in the format `lh(FACE, HEIGHT)`.';
+ }
+ $family: smart-quote(nth($props, 1));
+ $scale: smart-quote(nth($props, 2));
+ @if not map-has-key($project-cap-heights, $family) {
+ @error '#{$family} is not a valid font family token. '
+ + 'Valid tokens: #{map-keys($project-cap-heights)}';
+ }
+ @if not map-get($system-line-height, $scale) {
+ @error '`#{$scale}` is not a valid line-height token. '
+ + 'Valid tokens: #{map-keys($system-line-height)}';
+ }
+ @if not map-get($project-cap-heights, $family) {
+ @return false;
+ }
+ $this-cap: map-get($project-cap-heights, $family);
+ $this-line-height: map-get($system-line-height, $scale);
+ $normalized-line-height: $this-line-height / ($system-base-cap-height / $this-cap);
+
+ @return $normalized-line-height;
+}
+@function line-height($props...) {
+ @return lh($props...);
+}
+@import "../../node_modules/uswds/dist/scss/core/system-tokens";
+@import "../../node_modules/uswds/dist/scss/core/variables";
+@import "../../node_modules/uswds/dist/scss/core/properties";
+@import "../../node_modules/uswds/dist/scss/core/mixins/all";
+@import "../../node_modules/uswds/dist/scss/core/placeholders/all";
+@import "../../node_modules/uswds/dist/scss/core/deprecated";
+@import "../../node_modules/uswds/dist/scss/core/notifications";
+@import "../../node_modules/uswds/dist/scss/packages/global";
+@import "../../node_modules/uswds/dist/scss/packages/uswds-components";
+@import "../../node_modules/uswds/dist/scss/packages/uswds-utilities";
+button {
+ line-height: inherit;
+}
@import 'functions/focus';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment