0-settings-tools

s_config   

Note: visit the { } Styles tab for the scss.

Copy
Edit
<!-- components/0-settings-tools/s_config.txp --> <h2>Note: visit the { } Styles tab for the scss.</h2>
Copy
Copy
Edit
/* scss/0-settings-tools/_s_config.scss */ // required as sass variables for Shevy to work $base-font-size: 1rem; // 16px //$base-font-size: clamp(0.875rem, calc(5vw * 1rem), 1.125rem); $base-line-height: 1.5; // 24px // repeated below as a css variable $base-spacing-shevy: ( base-font-size: $base-font-size, base-line-height: $base-line-height ); @function my-bs($factor: 1) { // Default factor of one @return bs($factor, $base-spacing-shevy); } // https://www.smashingmagazine.com/2016/05/fluid-typography/ $minScreen: 24rem; // 384px $maxScreen: 160rem; // 2560px $minFont: 1rem; $maxFont: 1.563rem; // Major Third type scale for headings: https://type-scale.com $h1: 3.052; $h2: 2.441; $h3: 1.953; $h4: 1.563; $h5: 1.25; $h6: 1; $type-measure: 72ch; :root { --base-unit: 1.5rem; --base-unit--ss: calc(var(--base-unit) / 4); --base-unit--s: calc(var(--base-unit) / 2); --base-unit--b: calc(var(--base-unit) * 2); --base-line-height: 1.5rem; --thumb-background-colour: var(--whiteLC); --hamburger-background-colour: var(--whiteLC); --type-measure: 72ch; } $mobile: 380px; $small: 480px; $medium: 720px; $desktop: 1318px; @media (orientation: landscape) { } @media (orientation: portrait) { }
Copy
Edit

s_mixins   

Copy
Edit
<!-- components/0-settings-tools/s_mixins.txp -->
Copy
Copy
Edit
/* scss/0-settings-tools/_s_mixins.scss */ // ========================================================================= // // PRECISE CONTROL OVER RESPONSIVE TYPOGRAPHY FOR SASS // --------------------------------------------------- // Indrek Paas @indrekpaas // // Inspired by Mike Riethmuller's Precise control over responsive typography // http://madebymike.com.au/writing/precise-control-responsive-typography/ // // Borrowed `strip-unit` function from Hugo Giraudel // https://css-tricks.com/snippets/sass/strip-unit-function/ // // 02.04.2018 Remove `screen` keyword from media queries // 11.08.2016 Remove redundant `&` self-reference // 31.03.2016 Remove redundant parenthesis from output // 02.10.2015 Add support for multiple properties // 24.04.2015 Initial release // // ========================================================================= @mixin fluid-type($properties, $min-vw, $max-vw, $min-value, $max-value) { @each $property in $properties { #{$property}: $min-value; } @media (min-width: $min-vw) { @each $property in $properties { #{$property}: calc(#{$min-value} + #{strip-unit($max-value - $min-value)} * (100vw - #{$min-vw}) / #{strip-unit($max-vw - $min-vw)}); } } @media (min-width: $max-vw) { @each $property in $properties { #{$property}: $max-value; } } } @function strip-unit($number) { @if type-of($number) == "number" and not unitless($number) { @return $number / ($number * 0 + 1); } @return $number; } @import 'shevy/_shevy.scss'; @import '_s.quantity-queries.scss'
Copy
Edit
/* js/s_mixins.js */

s_shevy-config   

Copy
Edit
<!-- components/0-settings-tools/s_shevy-config.txp -->
Copy
Copy
Edit
/* scss/0-settings-tools/_s_shevy-config.scss */ // https://kyleshevlin.github.io/shevy/ @mixin heading($map: $shevy) { $settings: settings($map); $base-font-unit: base-font-unit($settings); $base-unit-multiplier: base-unit-multiplier($base-font-unit); $base-font-size: base-font-size($settings); $base-line-height: base-line-height($settings); $line-height-spacing: line-height-spacing(1, $settings); $base-spacing: base-spacing(1, $settings); $font-scale-length: length(map-get($settings, 'base-font-scale')); $font-unit-ems-bool: if($base-font-unit == 'em', true, false); $margin-bottom-bool: map-get($settings, 'margin-bottom'); @for $i from 1 through $font-scale-length { $font-scale-value: get-font-scale-value($i, $settings); $font-size: $base-font-size * $font-scale-value; $line-height: 0; $margin-bottom: 0; // Line Height Calculation @if $font-size <= $line-height-spacing { $line-height: $line-height-spacing; } @else { $increment: 1.5; // Use half increments, while technically breaking the baseline, they are more aesthetically pleasing and still mathematically sound @while line-height-spacing($increment, $settings) <= $font-size { $increment: $increment + .5; } @if $font-unit-ems-bool { $line-height: line-height-spacing($increment, $settings) / $font-size; } @else { $line-height: line-height-spacing($increment, $settings); } } // Margin Bottom Calculation @if $margin-bottom-bool { @if $font-unit-ems-bool { $margin-bottom: $base-spacing / $font-size * $base-unit-multiplier; } @else { $margin-bottom: $base-spacing; } } // Heading Output font-size: $font-size; line-height: $line-height; margin-bottom: $margin-bottom; } } $h1-shevy: ( base-font-scale: ($h1) ); $h2-shevy: ( base-font-scale: ($h2) ); $h3-shevy: ( base-font-scale: ($h3) ); $h4-shevy: ( base-font-scale: ($h4) ); $h5-shevy: ( base-font-scale: ($h5) ); $shevy: ( base-font-size: $base-font-size, base-line-height: $base-line-height, base-font-scale: ($h1, $h2, $h3, $h4, $h5, 1), // using Major Third type scale: https://type-scale.com margin-bottom: true, proximity: false, proximity-factor: .85 ); $shevy-small: ( base-font-size: $base-font-size * .875, //14px base-line-height: $base-line-height, base-font-scale: ($h1, $h2, $h3, $h4, $h5, 1), // using Major Third type scale: https://type-scale.com margin-bottom: true, proximity: false, proximity-factor: .85 ); $shevy-lede: ( base-font-size: $base-font-size * 2, //32px base-line-height: 1.25,// $base-line-height, base-font-scale: ($h1, $h2, $h3, $h4, $h5, 1), // using Major Third type scale: https://type-scale.com margin-bottom: true, proximity: false, proximity-factor: .85 ); // $shevy-ssmall: ( // base-font-size: $base-font-size * .75, //12px // base-line-height: $base-line-height, // base-font-scale: ($h1, $h2, $h3, $h4, $h5, 1), // using Major Third type scale: https://type-scale.com // margin-bottom: false, // proximity: false, // proximity-factor: .85 // );