Created
February 2, 2022 13:30
-
-
Save SvenBudak/8f898ca37985630db9ea9dc8e9e4eca2 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://material.angular.io/cdk/layout/overview#predefined-breakpoints | |
$res-xs: 0 !default; // Smartphone | |
$res-sm: 600px !default; // Tablet | |
$res-md: 960px !default; // Large Tablet | |
$res-lg: 1280px !default; // Large Tablet and Notebooks | |
$res-xl: 1920px !default; // Desktop + | |
@function em($pixels, $context: 16px) { | |
@return ($pixels / $context); | |
} | |
@function rem($pixels, $context: 16px) { | |
@return ($pixels / $context) * 1rem; | |
} | |
// MEDIA QUERY MIXINS | |
////////////////////////////////////////// | |
@mixin media-min($var) { | |
@media only screen and (min-width: $var) { | |
@content; | |
} | |
} | |
@mixin media-min-and-orientation($var, $orientation) { | |
@media only screen and (min-width: $var) and (orientation: $orientation) { | |
@content; | |
} | |
} | |
@mixin media-max($var) { | |
@media only screen and (max-width: $var - 1px) { | |
@content; | |
} | |
} | |
@mixin media-max-and-orientation($var, $orientation) { | |
@media only screen and (max-width: $var - 1px) and (orientation: $orientation) { | |
@content; | |
} | |
} | |
@mixin media-from-to($var1, $var2) { | |
@media only screen and (min-width: $var1) and (max-width: $var2 - 1px) { | |
@content; | |
} | |
} | |
@mixin media-orientation($orientation) { | |
@media only screen and (orientation: $orientation) { | |
@content; | |
} | |
} | |
// Headline Styles | |
@mixin headline-style($var: 'h1', $important: 'normal') { | |
@if ($var == 'h1') { | |
@if ($important == 'normal') { | |
font-size: var(--h1-font-size); | |
font-weight: var(--h1-font-weight); | |
line-height: var(--h1-line-height); | |
} | |
@if ($important == 'important') { | |
font-size: var(--h1-font-size) !important; | |
font-weight: var(--h1-font-weight) !important; | |
line-height: var(--h1-line-height) !important; | |
} | |
} | |
@if ($var == 'h2') { | |
@if ($important == 'normal') { | |
font-size: var(--h2-font-size); | |
font-weight: var(--h2-font-weight); | |
line-height: var(--h2-line-height); | |
} | |
@if ($important == 'important') { | |
font-size: var(--h2-font-size) !important; | |
font-weight: var(--h2-font-weight) !important; | |
line-height: var(--h2-line-height) !important; | |
} | |
} | |
@if ($var == 'h3') { | |
@if ($important == 'normal') { | |
font-size: var(--h3-font-size); | |
font-weight: var(--h3-font-weight); | |
line-height: var(--h3-line-height); | |
} | |
@if ($important == 'important') { | |
font-size: var(--h3-font-size) !important; | |
font-weight: var(--h3-font-weight) !important; | |
line-height: var(--h3-line-height) !important; | |
} | |
} | |
@if ($var == 'h4') { | |
@if ($important == 'normal') { | |
font-size: var(--h4-font-size); | |
font-weight: var(--h4-font-weight); | |
line-height: var(--h4-line-height); | |
} | |
@if ($important == 'important') { | |
font-size: var(--h4-font-size) !important; | |
font-weight: var(--h4-font-weight) !important; | |
line-height: var(--h4-line-height) !important; | |
} | |
} | |
@if ($var == 'h5') { | |
@if ($important == 'normal') { | |
font-size: var(--h5-font-size); | |
font-weight: var(--h5-font-weight); | |
line-height: var(--h5-line-height); | |
} | |
@if ($important == 'important') { | |
font-size: var(--h5-font-size) !important; | |
font-weight: var(--h5-font-weight) !important; | |
line-height: var(--h5-line-height) !important; | |
} | |
} | |
@if ($var == 'h6') { | |
@if ($important == 'normal') { | |
font-size: var(--h6-font-size); | |
font-weight: var(--h6-font-weight); | |
line-height: var(--h6-line-height); | |
} | |
@if ($important == 'important') { | |
font-size: var(--h6-font-size) !important; | |
font-weight: var(--h6-font-weight) !important; | |
line-height: var(--h6-line-height) !important; | |
} | |
} | |
} | |
// Typo Styles | |
@mixin typo-style($var: 'default', $important: 'normal') { | |
@if ($var == 'ultra-small') { | |
@if ($important == 'normal') { | |
font-size: var(--paragraph-ultra-small-font-size); | |
font-weight: var(--paragraph-ultra-small-font-weight); | |
line-height: var(--paragraph-ultra-small-line-height); | |
} | |
@if ($important == 'important') { | |
font-size: var(--paragraph-ultra-small-font-size) !important; | |
font-weight: var(--paragraph-ultra-small-font-weight) !important; | |
line-height: var(--paragraph-ultra-small-line-height) !important; | |
} | |
} | |
@if ($var == 'very-small') { | |
@if ($important == 'normal') { | |
font-size: var(--paragraph-very-small-font-size); | |
font-weight: var(--paragraph-very-small-font-weight); | |
line-height: var(--paragraph-very-small-line-height); | |
} | |
@if ($important == 'important') { | |
font-size: var(--paragraph-very-small-font-size) !important; | |
font-weight: var(--paragraph-very-small-font-weight) !important; | |
line-height: var(--paragraph-very-small-line-height) !important; | |
} | |
} | |
@if ($var == 'small') { | |
@if ($important == 'normal') { | |
font-size: var(--paragraph-small-font-size); | |
font-weight: var(--paragraph-small-font-weight); | |
line-height: var(--paragraph-small-line-height); | |
} | |
@if ($important == 'important') { | |
font-size: var(--paragraph-small-font-size) !important; | |
font-weight: var(--paragraph-small-font-weight) !important; | |
line-height: var(--paragraph-small-line-height) !important; | |
} | |
} | |
@if ($var == 'default') { | |
@if ($important == 'normal') { | |
font-size: var(--paragraph-default-font-size); | |
font-weight: var(--paragraph-default-font-weight); | |
line-height: var(--paragraph-default-line-height); | |
} | |
@if ($important == 'important') { | |
font-size: var(--paragraph-default-font-size) !important; | |
font-weight: var(--paragraph-default-font-weight) !important; | |
line-height: var(--paragraph-default-line-height) !important; | |
} | |
} | |
@if ($var == 'large') { | |
@if ($important == 'normal') { | |
font-size: var(--paragraph-large-font-size); | |
font-weight: var(--paragraph-large-font-weight); | |
line-height: var(--paragraph-large-line-height); | |
} | |
@if ($important == 'important') { | |
font-size: var(--paragraph-large-font-size) !important; | |
font-weight: var(--paragraph-large-font-weight) !important; | |
line-height: var(--paragraph-large-line-height) !important; | |
} | |
} | |
@if ($var == 'very-large') { | |
@if ($important == 'normal') { | |
font-size: var(--paragraph-very-large-font-size); | |
font-weight: var(--paragraph-very-large-font-weight); | |
line-height: var(--paragraph-very-large-line-height); | |
} | |
@if ($important == 'important') { | |
font-size: var(--paragraph-very-large-font-size) !important; | |
font-weight: var(--paragraph-very-large-font-weight) !important; | |
line-height: var(--paragraph-very-large-line-height) !important; | |
} | |
} | |
@if ($var == 'ultra-large') { | |
@if ($important == 'normal') { | |
font-size: var(--paragraph-ultra-large-font-size); | |
font-weight: var(--paragraph-ultra-large-font-weight); | |
line-height: var(--paragraph-ultra-large-line-height); | |
} | |
@if ($important == 'important') { | |
font-size: var(--paragraph-ultra-large-font-size) !important; | |
font-weight: var(--paragraph-ultra-large-font-weight) !important; | |
line-height: var(--paragraph-ultra-large-line-height) !important; | |
} | |
} | |
} | |
// stylelint-disable property-blacklist, scss/dollar-variable-default | |
// SCSS RFS mixin | |
// | |
// Automated responsive values for font sizes, paddings, margins and much more | |
// | |
// Licensed under MIT (https://github.com/twbs/rfs/blob/main/LICENSE) | |
// Configuration | |
// Base value | |
$rfs-base-value: 1.25rem !default; | |
$rfs-unit: rem !default; | |
@if $rfs-unit != rem and $rfs-unit != px { | |
@error "`#{$rfs-unit}` is not a valid unit for $rfs-unit. Use `px` or `rem`."; | |
} | |
// Breakpoint at where values start decreasing if screen width is smaller | |
$rfs-breakpoint: 1200px !default; | |
$rfs-breakpoint-unit: px !default; | |
@if $rfs-breakpoint-unit != px and $rfs-breakpoint-unit != em and $rfs-breakpoint-unit != rem { | |
@error "`#{$rfs-breakpoint-unit}` is not a valid unit for $rfs-breakpoint-unit. Use `px`, `em` or `rem`."; | |
} | |
// Resize values based on screen height and width | |
$rfs-two-dimensional: false !default; | |
// Factor of decrease | |
$rfs-factor: 10 !default; | |
@if type-of($rfs-factor) != number or $rfs-factor <= 1 { | |
@error "`#{$rfs-factor}` is not a valid $rfs-factor, it must be greater than 1."; | |
} | |
// Mode. Possibilities: "min-media-query", "max-media-query" | |
$rfs-mode: min-media-query !default; | |
// Generate enable or disable classes. Possibilities: false, "enable" or "disable" | |
$rfs-class: false !default; | |
// 1 rem = $rfs-rem-value px | |
$rfs-rem-value: 16 !default; | |
// Safari iframe resize bug: https://github.com/twbs/rfs/issues/14 | |
$rfs-safari-iframe-resize-bug-fix: false !default; | |
// Disable RFS by setting $enable-rfs to false | |
$enable-rfs: true !default; | |
// Cache $rfs-base-value unit | |
$rfs-base-value-unit: unit($rfs-base-value); | |
@function divide($dividend, $divisor, $precision: 10) { | |
$sign: if($dividend > 0 and $divisor > 0 or $dividend < 0 and $divisor < 0, 1, -1); | |
$dividend: abs($dividend); | |
$divisor: abs($divisor); | |
@if $dividend == 0 { | |
@return 0; | |
} | |
@if $divisor == 0 { | |
@error "Cannot divide by 0"; | |
} | |
$remainder: $dividend; | |
$result: 0; | |
$factor: 10; | |
@while ($remainder > 0 and $precision >= 0) { | |
$quotient: 0; | |
@while ($remainder >= $divisor) { | |
$remainder: $remainder - $divisor; | |
$quotient: $quotient + 1; | |
} | |
$result: $result * 10 + $quotient; | |
$factor: $factor * .1; | |
$remainder: $remainder * 10; | |
$precision: $precision - 1; | |
@if ($precision < 0 and $remainder >= $divisor * 5) { | |
$result: $result + 1; | |
} | |
} | |
$result: $result * $factor * $sign; | |
$dividend-unit: unit($dividend); | |
$divisor-unit: unit($divisor); | |
$unit-map: ( | |
"px": 1px, | |
"rem": 1rem, | |
"em": 1em, | |
"%": 1% | |
); | |
@if ($dividend-unit != $divisor-unit and map-has-key($unit-map, $dividend-unit)) { | |
$result: $result * map-get($unit-map, $dividend-unit); | |
} | |
@return $result; | |
} | |
// Remove px-unit from $rfs-base-value for calculations | |
@if $rfs-base-value-unit == px { | |
$rfs-base-value: divide($rfs-base-value, $rfs-base-value * 0 + 1); | |
} | |
@else if $rfs-base-value-unit == rem { | |
$rfs-base-value: divide($rfs-base-value, divide($rfs-base-value * 0 + 1, $rfs-rem-value)); | |
} | |
// Cache $rfs-breakpoint unit to prevent multiple calls | |
$rfs-breakpoint-unit-cache: unit($rfs-breakpoint); | |
// Remove unit from $rfs-breakpoint for calculations | |
@if $rfs-breakpoint-unit-cache == px { | |
$rfs-breakpoint: divide($rfs-breakpoint, $rfs-breakpoint * 0 + 1); | |
} | |
@else if $rfs-breakpoint-unit-cache == rem or $rfs-breakpoint-unit-cache == "em" { | |
$rfs-breakpoint: divide($rfs-breakpoint, divide($rfs-breakpoint * 0 + 1, $rfs-rem-value)); | |
} | |
// Calculate the media query value | |
$rfs-mq-value: if($rfs-breakpoint-unit == px, #{$rfs-breakpoint}px, #{divide($rfs-breakpoint, $rfs-rem-value)}#{$rfs-breakpoint-unit}); | |
$rfs-mq-property-width: if($rfs-mode == max-media-query, max-width, min-width); | |
$rfs-mq-property-height: if($rfs-mode == max-media-query, max-height, min-height); | |
// Internal mixin used to determine which media query needs to be used | |
@mixin _rfs-media-query { | |
@if $rfs-two-dimensional { | |
@if $rfs-mode == max-media-query { | |
@media (#{$rfs-mq-property-width}: #{$rfs-mq-value}), (#{$rfs-mq-property-height}: #{$rfs-mq-value}) { | |
@content; | |
} | |
} | |
@else { | |
@media (#{$rfs-mq-property-width}: #{$rfs-mq-value}) and (#{$rfs-mq-property-height}: #{$rfs-mq-value}) { | |
@content; | |
} | |
} | |
} | |
@else { | |
@media (#{$rfs-mq-property-width}: #{$rfs-mq-value}) { | |
@content; | |
} | |
} | |
} | |
// Internal mixin that adds disable classes to the selector if needed. | |
@mixin _rfs-rule { | |
@if $rfs-class == disable and $rfs-mode == max-media-query { | |
// Adding an extra class increases specificity, which prevents the media query to override the property | |
&, | |
.disable-rfs &, | |
&.disable-rfs { | |
@content; | |
} | |
} | |
@else if $rfs-class == enable and $rfs-mode == min-media-query { | |
.enable-rfs &, | |
&.enable-rfs { | |
@content; | |
} | |
} | |
@else { | |
@content; | |
} | |
} | |
// Internal mixin that adds enable classes to the selector if needed. | |
@mixin _rfs-media-query-rule { | |
@if $rfs-class == enable { | |
@if $rfs-mode == min-media-query { | |
@content; | |
} | |
@include _rfs-media-query { | |
.enable-rfs &, | |
&.enable-rfs { | |
@content; | |
} | |
} | |
} | |
@else { | |
@if $rfs-class == disable and $rfs-mode == min-media-query { | |
.disable-rfs &, | |
&.disable-rfs { | |
@content; | |
} | |
} | |
@include _rfs-media-query { | |
@content; | |
} | |
} | |
} | |
// Helper function to get the formatted non-responsive value | |
@function rfs-value($values) { | |
// Convert to list | |
$values: if(type-of($values) != list, ($values,), $values); | |
$val: ''; | |
// Loop over each value and calculate value | |
@each $value in $values { | |
@if $value == 0 { | |
$val: $val + ' 0'; | |
} | |
@else { | |
// Cache $value unit | |
$unit: if(type-of($value) == "number", unit($value), false); | |
@if $unit == px { | |
// Convert to rem if needed | |
$val: $val + ' ' + if($rfs-unit == rem, #{divide($value, $value * 0 + $rfs-rem-value)}rem, $value); | |
} | |
@else if $unit == rem { | |
// Convert to px if needed | |
$val: $val + ' ' + if($rfs-unit == px, #{divide($value, $value * 0 + 1) * $rfs-rem-value}px, $value); | |
} | |
@else { | |
// If $value isn't a number (like inherit) or $value has a unit (not px or rem, like 1.5em) or $ is 0, just print the value | |
$val: $val + ' ' + $value; | |
} | |
} | |
} | |
// Remove first space | |
@return unquote(str-slice($val, 2)); | |
} | |
// Helper function to get the responsive value calculated by RFS | |
@function rfs-fluid-value($values) { | |
// Convert to list | |
$values: if(type-of($values) != list, ($values,), $values); | |
$val: ''; | |
// Loop over each value and calculate value | |
@each $value in $values { | |
@if $value == 0 { | |
$val: $val + ' 0'; | |
} | |
@else { | |
// Cache $value unit | |
$unit: if(type-of($value) == "number", unit($value), false); | |
// If $value isn't a number (like inherit) or $value has a unit (not px or rem, like 1.5em) or $ is 0, just print the value | |
@if not $unit or $unit != px and $unit != rem { | |
$val: $val + ' ' + $value; | |
} | |
@else { | |
// Remove unit from $value for calculations | |
$value: divide($value, $value * 0 + if($unit == px, 1, divide(1, $rfs-rem-value))); | |
// Only add the media query if the value is greater than the minimum value | |
@if abs($value) <= $rfs-base-value or not $enable-rfs { | |
$val: $val + ' ' + if($rfs-unit == rem, #{divide($value, $rfs-rem-value)}rem, #{$value}px); | |
} | |
@else { | |
// Calculate the minimum value | |
$value-min: $rfs-base-value + divide(abs($value) - $rfs-base-value, $rfs-factor); | |
// Calculate difference between $value and the minimum value | |
$value-diff: abs($value) - $value-min; | |
// Base value formatting | |
$min-width: if($rfs-unit == rem, #{divide($value-min, $rfs-rem-value)}rem, #{$value-min}px); | |
// Use negative value if needed | |
$min-width: if($value < 0, -$min-width, $min-width); | |
// Use `vmin` if two-dimensional is enabled | |
$variable-unit: if($rfs-two-dimensional, vmin, vw); | |
// Calculate the variable width between 0 and $rfs-breakpoint | |
$variable-width: #{divide($value-diff * 100, $rfs-breakpoint)}#{$variable-unit}; | |
// Return the calculated value | |
$val: $val + ' calc(' + $min-width + if($value < 0, ' - ', ' + ') + $variable-width + ')'; | |
} | |
} | |
} | |
} | |
// Remove first space | |
@return unquote(str-slice($val, 2)); | |
} | |
// RFS mixin | |
@mixin rfs($values, $property: font-size) { | |
@if $values != null { | |
$val: rfs-value($values); | |
$fluidVal: rfs-fluid-value($values); | |
// Do not print the media query if responsive & non-responsive values are the same | |
@if $val == $fluidVal { | |
#{$property}: $val; | |
} | |
@else { | |
@include _rfs-rule { | |
#{$property}: if($rfs-mode == max-media-query, $val, $fluidVal); | |
// Include safari iframe resize fix if needed | |
min-width: if($rfs-safari-iframe-resize-bug-fix, (0 * 1vw), null); | |
} | |
@include _rfs-media-query-rule { | |
#{$property}: if($rfs-mode == max-media-query, $fluidVal, $val); | |
} | |
} | |
} | |
} | |
// Shorthand helper mixins | |
@mixin font-size($value) { | |
@include rfs($value); | |
} | |
@mixin padding($value) { | |
@include rfs($value, padding); | |
} | |
@mixin padding-top($value) { | |
@include rfs($value, padding-top); | |
} | |
@mixin padding-right($value) { | |
@include rfs($value, padding-right); | |
} | |
@mixin padding-bottom($value) { | |
@include rfs($value, padding-bottom); | |
} | |
@mixin padding-left($value) { | |
@include rfs($value, padding-left); | |
} | |
@mixin margin($value) { | |
@include rfs($value, margin); | |
} | |
@mixin margin-top($value) { | |
@include rfs($value, margin-top); | |
} | |
@mixin margin-right($value) { | |
@include rfs($value, margin-right); | |
} | |
@mixin margin-bottom($value) { | |
@include rfs($value, margin-bottom); | |
} | |
@mixin margin-left($value) { | |
@include rfs($value, margin-left); | |
} | |
// Typography | |
$heading-font-weight: 700 !default; | |
$paragraph-font-weight: 400 !default; | |
// Heading 1 | |
$h1-font-size: #{rfs-fluid-value(rem(64px))} !default; | |
$h1-font-weight: $heading-font-weight !default; | |
$h1-line-height: #{em(70px, 64px)} !default; | |
// Heading 2 | |
$h2-font-size: #{rfs-fluid-value(rem(44px))} !default; | |
$h2-font-weight: $heading-font-weight !default; | |
$h2-line-height: #{em(52px, 44px)} !default; | |
// Heading 3 | |
$h3-font-size: #{rfs-fluid-value(rem(32px))} !default; | |
$h3-font-weight: $heading-font-weight !default; | |
$h3-line-height: #{em(40px, 32px)} !default; | |
// Heading 4 | |
$h4-font-size: #{rfs-fluid-value(rem(28px))} !default; | |
$h4-font-weight: $heading-font-weight !default; | |
$h4-line-height: #{em(32px, 28px)} !default; | |
// Heading 5 | |
$h5-font-size: #{rfs-fluid-value(rem(22px))} !default; | |
$h5-font-weight: $heading-font-weight !default; | |
$h5-line-height: #{em(24px, 22px)} !default; | |
// Heading 6 | |
$h6-font-size: #{rfs-fluid-value(rem(18px))} !default; | |
$h6-font-weight: $heading-font-weight !default; | |
$h6-line-height: #{em(24px, 18px)} !default; | |
// Paragraph ultra-small | |
$paragraph-ultra-small-font-size: #{rfs-fluid-value(rem(10px))} !default; | |
$paragraph-ultra-small-font-weight: $paragraph-font-weight !default; | |
$paragraph-ultra-small-line-height: #{em(12px, 10px)} !default; | |
// Paragraph very-small | |
$paragraph-very-small-font-size: #{rfs-fluid-value(rem(12px))} !default; | |
$paragraph-very-small-font-weight: $paragraph-font-weight !default; | |
$paragraph-very-small-line-height: #{em(14px, 12px)} !default; | |
// Paragraph small | |
$paragraph-small-font-size: #{rfs-fluid-value(rem(14px))} !default; | |
$paragraph-small-font-weight: $paragraph-font-weight !default; | |
$paragraph-small-line-height: #{em(18px, 14px)} !default; | |
// Paragraph default | |
$paragraph-default-font-size: #{rfs-fluid-value(rem(16px))} !default; | |
$paragraph-default-font-weight: $paragraph-font-weight !default; | |
$paragraph-default-line-height: #{em(24px, 16px)} !default; | |
// Paragraph large | |
$paragraph-large-font-size: #{rfs-fluid-value(rem(18px))} !default; | |
$paragraph-large-font-weight: $paragraph-font-weight !default; | |
$paragraph-large-line-height: #{em(28px, 18px)} !default; | |
// Paragraph very-large | |
$paragraph-very-large-font-size: #{rfs-fluid-value(rem(22px))} !default; | |
$paragraph-very-large-font-weight: $paragraph-font-weight !default; | |
$paragraph-very-large-line-height: #{em(30px, 22px)} !default; | |
// Paragraph ultra-large | |
$paragraph-ultra-large-font-size: #{rfs-fluid-value(rem(26px))} !default; | |
$paragraph-ultra-large-font-weight: $paragraph-font-weight !default; | |
$paragraph-ultra-large-line-height: #{em(34px, 26px)} !default; | |
:root { | |
// Typography | |
--heading-font-weight: #{$heading-font-weight}; | |
--paragraph-font-weight: #{$paragraph-font-weight}; | |
// Heading 1 | |
--h1-font-size: #{$h1-font-size}; | |
--h1-font-weight: #{$h1-font-weight}; | |
--h1-line-height: #{$h1-line-height}; | |
// Heading 2 | |
--h2-font-size: #{$h2-font-size}; | |
--h2-font-weight: #{$h2-font-weight}; | |
--h2-line-height: #{$h2-line-height}; | |
// Heading 3 | |
--h3-font-size: #{$h3-font-size}; | |
--h3-font-weight: #{$h3-font-weight}; | |
--h3-line-height: #{$h3-line-height}; | |
// Heading 4 | |
--h4-font-size: #{$h4-font-size}; | |
--h4-font-weight: #{$h4-font-weight}; | |
--h4-line-height: #{$h4-line-height}; | |
// Heading 5 | |
--h5-font-size: #{$h5-font-size}; | |
--h5-font-weight: #{$h5-font-weight}; | |
--h5-line-height: #{$h5-line-height}; | |
// Heading 6 | |
--h6-font-size: #{$h6-font-size}; | |
--h6-font-weight: #{$h6-font-weight}; | |
--h6-line-height: #{$h6-line-height}; | |
// Paragraph ultra-small | |
--paragraph-ultra-small-font-size: #{$paragraph-ultra-small-font-size}; | |
--paragraph-ultra-small-font-weight: #{$paragraph-ultra-small-font-weight}; | |
--paragraph-ultra-small-line-height: #{$paragraph-ultra-small-line-height}; | |
// Paragraph very-small | |
--paragraph-very-small-font-size: #{$paragraph-very-small-font-size}; | |
--paragraph-very-small-font-weight: #{$paragraph-very-small-font-weight}; | |
--paragraph-very-small-line-height: #{$paragraph-very-small-line-height}; | |
// Paragraph small | |
--paragraph-small-font-size: #{$paragraph-small-font-size}; | |
--paragraph-small-font-weight: #{$paragraph-small-font-weight}; | |
--paragraph-small-line-height: #{$paragraph-small-line-height}; | |
// Paragraph default | |
--paragraph-default-font-size: #{$paragraph-default-font-size}; | |
--paragraph-default-font-weight: #{$paragraph-default-font-weight}; | |
--paragraph-default-line-height: #{$paragraph-default-line-height}; | |
// Paragraph large | |
--paragraph-large-font-size: #{$paragraph-large-font-size}; | |
--paragraph-large-font-weight: #{$paragraph-large-font-weight}; | |
--paragraph-large-line-height: #{$paragraph-large-line-height}; | |
// Paragraph very-large | |
--paragraph-very-large-font-size: #{$paragraph-very-large-font-size}; | |
--paragraph-very-large-font-weight: #{$paragraph-very-large-font-weight}; | |
--paragraph-very-large-line-height: #{$paragraph-very-large-line-height}; | |
// Paragraph ultra-large | |
--paragraph-ultra-large-font-size: #{$paragraph-ultra-large-font-size}; | |
--paragraph-ultra-large-font-weight: #{$paragraph-ultra-large-font-weight}; | |
--paragraph-ultra-large-line-height: #{$paragraph-ultra-large-line-height}; | |
} | |
$breakpoints: ( | |
xs: $res-xs, | |
sm: $res-sm, | |
md: $res-md, | |
lg: $res-lg, | |
xl: $res-xl | |
) !default; | |
// Configure Utilities Typography Headline Styles | |
$headline-variants: 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' !default; | |
$headline-styles: true !default; | |
$headline-styles-breakpoints-min: false !default; | |
$headline-styles-breakpoints-max: false !default; | |
$headline-styles-breakpoints-from-to: false !default; | |
// Configure Utilities Typography Paragraph Styles | |
$paragraph-variants: 'ultra-small', 'very-small', 'small', 'default', 'large', 'very-large', 'ultra-large' !default; | |
$paragraph-styles: true !default; | |
$paragraph-styles-breakpoints-min: false !default; | |
$paragraph-styles-breakpoints-max: false !default; | |
$paragraph-styles-breakpoints-from-to: false !default; | |
// Headline Styles | |
// h1 { @include headline-style('h1'); } .h1-style { @include headline-style('h1', 'important'); } | |
// h2 { @include headline-style('h2'); } .h2-style { @include headline-style('h2', 'important'); } | |
// h3 { @include headline-style('h3'); } .h3-style { @include headline-style('h3', 'important'); } | |
// h4 { @include headline-style('h4'); } .h4-style { @include headline-style('h4', 'important'); } | |
// h5 { @include headline-style('h5'); } .h5-style { @include headline-style('h5', 'important'); } | |
// h6 { @include headline-style('h6'); } .h6-style { @include headline-style('h6', 'important'); } | |
// Paragraph Styles | |
// .typo-style-ultra-small { @include typo-style('ultra-small', 'important'); } | |
// .typo-style-very-small { @include typo-style('very-small', 'important'); } | |
// .typo-style-small { @include typo-style('small', 'important'); } | |
// p { @include typo-style('default'); } .typo-style-default { @include typo-style('default', 'important'); } | |
// .typo-style-large { @include typo-style('large', 'important'); } | |
// .typo-style-very-large { @include typo-style('very-large', 'important'); } | |
// .typo-style-ultra-large { @include typo-style('ultra-large', 'important'); } | |
// Headline Styles | |
@if $headline-styles { | |
@each $variant in $headline-variants { | |
.#{$variant}-style { | |
@include headline-style(#{$variant}, 'important'); | |
} | |
} | |
} | |
// Headline Styles with Breakpoints - Min | |
@if $headline-styles-breakpoints-min { | |
@each $breakpoint, $res in $breakpoints { | |
@include media-min($res) { | |
@each $variant in $headline-variants { | |
.#{$variant}-style-min-#{$breakpoint} { | |
@include headline-style(#{$variant}, 'important'); | |
} | |
} | |
} | |
} | |
} | |
// Headline Styles with Breakpoints - Max | |
@if $headline-styles-breakpoints-max { | |
@each $breakpoint, $res in $breakpoints { | |
@include media-max($res) { | |
@each $variant in $headline-variants { | |
.#{$variant}-style-max-#{$breakpoint} { | |
@include headline-style(#{$variant}, 'important'); | |
} | |
} | |
} | |
} | |
} | |
// Headline Styles with Breakpoints - FromTo | |
@if $headline-styles-breakpoints-from-to { | |
@each $breakpointFrom, $resFrom in $breakpoints { | |
$typo-breakpoint-keys: map-keys($breakpoints); | |
$iFrom: index($typo-breakpoint-keys, $breakpointFrom); | |
@each $breakpointTo, $resTo in $breakpoints { | |
$iTo: index($typo-breakpoint-keys, $breakpointTo); | |
@if $iTo > $iFrom { | |
@include media-from-to($resFrom, $resTo) { | |
@each $variant in $headline-variants { | |
.#{$variant}-style-from-#{$breakpointFrom}-to-#{$breakpointTo} { | |
@include headline-style(#{$variant}, 'important'); | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
// Paragraph Styles | |
@if $paragraph-styles { | |
@each $variant in $paragraph-variants { | |
.typo-style-#{$variant} { | |
@include typo-style(#{$variant}, 'important'); | |
} | |
} | |
} | |
// Paragraph Styles with Breakpoints - Min | |
@if $paragraph-styles-breakpoints-min { | |
@each $breakpoint, $res in $breakpoints { | |
@include media-min($res) { | |
@each $variant in $paragraph-variants { | |
.typo-style-#{$variant}-min-#{$breakpoint} { | |
@include typo-style(#{$variant}, 'important'); | |
} | |
} | |
} | |
} | |
} | |
// Paragraph Styles with Breakpoints - Max | |
@if $paragraph-styles-breakpoints-max { | |
@each $breakpoint, $res in $breakpoints { | |
@include media-max($res) { | |
@each $variant in $paragraph-variants { | |
.typo-style-#{$variant}-max-#{$breakpoint} { | |
@include typo-style(#{$variant}, 'important'); | |
} | |
} | |
} | |
} | |
} | |
// Paragraph Styles with Breakpoints - FromTo | |
@if $paragraph-styles-breakpoints-from-to { | |
@each $breakpointFrom, $resFrom in $breakpoints { | |
$typo-breakpoint-keys: map-keys($breakpoints); | |
$iFrom: index($typo-breakpoint-keys, $breakpointFrom); | |
@each $breakpointTo, $resTo in $breakpoints { | |
$iTo: index($typo-breakpoint-keys, $breakpointTo); | |
@if $iTo > $iFrom { | |
@include media-from-to($resFrom, $resTo) { | |
@each $variant in $paragraph-variants { | |
.typo-style-#{$variant}-from-#{$breakpointFrom}-to-#{$breakpointTo} { | |
@include typo-style(#{$variant}, 'important'); | |
} | |
} | |
} | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:root { | |
--heading-font-weight: 700; | |
--paragraph-font-weight: 400; | |
--h1-font-size: calc(1.525rem + 3.3vw); | |
--h1-font-weight: 700; | |
--h1-line-height: 1.09375; | |
--h2-font-size: calc(1.4rem + 1.8vw); | |
--h2-font-weight: 700; | |
--h2-line-height: 1.1818181818; | |
--h3-font-size: calc(1.325rem + 0.9vw); | |
--h3-font-weight: 700; | |
--h3-line-height: 1.25; | |
--h4-font-size: calc(1.3rem + 0.6vw); | |
--h4-font-weight: 700; | |
--h4-line-height: 1.1428571429; | |
--h5-font-size: calc(1.2625rem + 0.15vw); | |
--h5-font-weight: 700; | |
--h5-line-height: 1.0909090909; | |
--h6-font-size: 1.125rem; | |
--h6-font-weight: 700; | |
--h6-line-height: 1.3333333333; | |
--paragraph-ultra-small-font-size: 0.625rem; | |
--paragraph-ultra-small-font-weight: 400; | |
--paragraph-ultra-small-line-height: 1.2; | |
--paragraph-very-small-font-size: 0.75rem; | |
--paragraph-very-small-font-weight: 400; | |
--paragraph-very-small-line-height: 1.1666666667; | |
--paragraph-small-font-size: 0.875rem; | |
--paragraph-small-font-weight: 400; | |
--paragraph-small-line-height: 1.2857142857; | |
--paragraph-default-font-size: 1rem; | |
--paragraph-default-font-weight: 400; | |
--paragraph-default-line-height: 1.5; | |
--paragraph-large-font-size: 1.125rem; | |
--paragraph-large-font-weight: 400; | |
--paragraph-large-line-height: 1.5555555556; | |
--paragraph-very-large-font-size: calc(1.2625rem + 0.15vw); | |
--paragraph-very-large-font-weight: 400; | |
--paragraph-very-large-line-height: 1.3636363636; | |
--paragraph-ultra-large-font-size: calc(1.2875rem + 0.45vw); | |
--paragraph-ultra-large-font-weight: 400; | |
--paragraph-ultra-large-line-height: 1.3076923077; | |
} | |
.typo-style-small { | |
font-size: var(--paragraph-small-font-size) !important; | |
font-weight: var(--paragraph-small-font-weight) !important; | |
line-height: var(--paragraph-small-line-height) !important; | |
} | |
p { | |
font-size: var(--paragraph-default-font-size); | |
font-weight: var(--paragraph-default-font-weight); | |
line-height: var(--paragraph-default-line-height); | |
} | |
.typo-style-default { | |
font-size: var(--paragraph-default-font-size) !important; | |
font-weight: var(--paragraph-default-font-weight) !important; | |
line-height: var(--paragraph-default-line-height) !important; | |
} | |
.typo-style-large { | |
font-size: var(--paragraph-large-font-size) !important; | |
font-weight: var(--paragraph-large-font-weight) !important; | |
line-height: var(--paragraph-large-line-height) !important; | |
} | |
.typo-style-very-large { | |
font-size: var(--paragraph-very-large-font-size) !important; | |
font-weight: var(--paragraph-very-large-font-weight) !important; | |
line-height: var(--paragraph-very-large-line-height) !important; | |
} | |
.typo-style-ultra-large { | |
font-size: var(--paragraph-ultra-large-font-size) !important; | |
font-weight: var(--paragraph-ultra-large-font-weight) !important; | |
line-height: var(--paragraph-ultra-large-line-height) !important; | |
} | |
.h1-style { | |
font-size: var(--h1-font-size) !important; | |
font-weight: var(--h1-font-weight) !important; | |
line-height: var(--h1-line-height) !important; | |
} | |
.h2-style { | |
font-size: var(--h2-font-size) !important; | |
font-weight: var(--h2-font-weight) !important; | |
line-height: var(--h2-line-height) !important; | |
} | |
.h3-style { | |
font-size: var(--h3-font-size) !important; | |
font-weight: var(--h3-font-weight) !important; | |
line-height: var(--h3-line-height) !important; | |
} | |
.h4-style { | |
font-size: var(--h4-font-size) !important; | |
font-weight: var(--h4-font-weight) !important; | |
line-height: var(--h4-line-height) !important; | |
} | |
.h5-style { | |
font-size: var(--h5-font-size) !important; | |
font-weight: var(--h5-font-weight) !important; | |
line-height: var(--h5-line-height) !important; | |
} | |
.h6-style { | |
font-size: var(--h6-font-size) !important; | |
font-weight: var(--h6-font-weight) !important; | |
line-height: var(--h6-line-height) !important; | |
} | |
.typo-style-ultra-small { | |
font-size: var(--paragraph-ultra-small-font-size) !important; | |
font-weight: var(--paragraph-ultra-small-font-weight) !important; | |
line-height: var(--paragraph-ultra-small-line-height) !important; | |
} | |
.typo-style-very-small { | |
font-size: var(--paragraph-very-small-font-size) !important; | |
font-weight: var(--paragraph-very-small-font-weight) !important; | |
line-height: var(--paragraph-very-small-line-height) !important; | |
} | |
.typo-style-small { | |
font-size: var(--paragraph-small-font-size) !important; | |
font-weight: var(--paragraph-small-font-weight) !important; | |
line-height: var(--paragraph-small-line-height) !important; | |
} | |
.typo-style-default { | |
font-size: var(--paragraph-default-font-size) !important; | |
font-weight: var(--paragraph-default-font-weight) !important; | |
line-height: var(--paragraph-default-line-height) !important; | |
} | |
.typo-style-large { | |
font-size: var(--paragraph-large-font-size) !important; | |
font-weight: var(--paragraph-large-font-weight) !important; | |
line-height: var(--paragraph-large-line-height) !important; | |
} | |
.typo-style-very-large { | |
font-size: var(--paragraph-very-large-font-size) !important; | |
font-weight: var(--paragraph-very-large-font-weight) !important; | |
line-height: var(--paragraph-very-large-line-height) !important; | |
} | |
.typo-style-ultra-large { | |
font-size: var(--paragraph-ultra-large-font-size) !important; | |
font-weight: var(--paragraph-ultra-large-font-weight) !important; | |
line-height: var(--paragraph-ultra-large-line-height) !important; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"sass": { | |
"compiler": "dart-sass/1.32.12", | |
"extensions": {}, | |
"syntax": "SCSS", | |
"outputStyle": "expanded" | |
}, | |
"autoprefixer": false | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment