Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/mod_ginger_foundation/lib/css/src/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ h3 {
@include size(margin-bottom, 0);
}

@include mq(min-width, 900) {
@include mq(min-width, 900px) {
h1 {
@include size(font-size, 41);
@include size(line-height, 44);
Expand Down
21 changes: 8 additions & 13 deletions modules/mod_ginger_foundation/lib/css/src/_mixins.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
@use "sass:math";

@function strip-unit($num) {
@return math.div($num, $num * 0 + 1);
}

@function px-to-rem($value) {
@return $value*0.1;
@return calc(#{$value} * 0.1);
}

/* Takes sizes in pixels and outputs both the pixel and rem values for the given property */
Expand All @@ -15,9 +11,10 @@
$remValues: '';

@for $i from 1 through $max {
$value: strip-unit(nth($values, $i));
$value: nth($values, $i);
$pxValues: #{$pxValues + $value}px;
$remValues: #{$remValues + px-to-rem($value)}rem;
$pxToRems: px-to-rem(#{$value}rem);
$remValues: #{$remValues + $pxToRems};

@if $i < $max {
$pxValues: #{$pxValues + " "};
Expand All @@ -35,9 +32,7 @@

/* Creates a mediaquery based on property and size in pixels */
@mixin mq($property, $size) {
$value: strip-unit($size);

@media only screen and (#{$property}: #{$value}px ) {
@media only screen and (#{$property}: $size ) {
@content;
}
}
Expand Down Expand Up @@ -117,8 +112,8 @@
&:before {
content: '';
display: inline-block;
@include size(width, 15px);
@include size(height, 15px);
@include size(width, 15);
@include size(height, 15);
@include size(margin-right, 15);
position: relative;
top: 2px;
Expand Down Expand Up @@ -173,7 +168,7 @@
display: block;
content: "";
width: 100%;
padding-top: math.div($height, $width) * 100%;
padding-top: calc(#{$height} / #{$width} * 100%);
}

> div {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@include size(margin-bottom, 10);
}

@include mq(min-width, 900) {
@include mq(min-width, 900px) {
.page-action-elements {
margin-top: 0px;
@include size(margin-bottom, 10);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@
}
}

@include mq(max-height, 500) {
@include mq(max-height, 500px) {
.is-open .global-nav__menu {
height: calc(100% - (#{$globalNavHeight + $globalNavHeight}px));
overflow-y: scroll;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
display: inline-block;
}

@include mq(min-width, 900) {
@include mq(min-width, 900px) {
.page-actions__author {
@include size(margin-bottom, 10);
}
Expand Down