-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add clamp and aspect-ratio helpers, 9.0.8
- Loading branch information
1 parent
26ca373
commit 7d22c43
Showing
12 changed files
with
91 additions
and
41 deletions.
There are no files selected for viewing
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "air-light", | ||
"version": "9.0.7", | ||
"version": "9.0.8", | ||
"description": "A minimalist WordPress starter theme.", | ||
"author": "Digitoimisto Dude Oy ([email protected])", | ||
"devDependencies": { | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
@use 'sass:math'; | ||
|
||
@mixin aspect-ratio($width, $height) { | ||
aspect-ratio: #{$width} / #{$height}; | ||
|
||
// Support for Safari 10-14 (Big Sur and earlier) | ||
@supports not (aspect-ratio: 1 / 1) { | ||
position: relative; | ||
|
||
&::before { | ||
content: ''; | ||
display: block; | ||
padding-top: math.div($height, $width) * 100%; | ||
width: 100%; | ||
} | ||
|
||
> .content { | ||
bottom: 0; | ||
left: 0; | ||
position: absolute; | ||
right: 0; | ||
top: 0; | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// stylelint-disable max-line-length | ||
@use 'sass:math'; | ||
|
||
// Easy CSS Clamp SCSS function | ||
// @source https://dev.to/christianmay21/easy-css-clamp-scss-mixin-1225 | ||
// Usage: font-size: clamp-calc(480px, 640px, 12px, 16px); | ||
@function clamp-calc($min-width, $max-width, $size-at-min-width, $size-at-max-width) { | ||
$slope: math.div($size-at-max-width - $size-at-min-width, $max-width - $min-width) or calc(($size-at-max-width - $size-at-min-width) / ($max-width - $min-width)); | ||
$y-axis-intersection: -1 * $min-width * $slope + $size-at-min-width; | ||
$return-value: clamp(#{$size-at-min-width}, #{$y-axis-intersection} + #{$slope} * 100vw, #{$size-at-max-width}); | ||
|
||
@return $return-value; | ||
} |
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