Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump Sass and migrate / to math.div() #1

Merged
merged 1 commit into from Jul 2, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions assets/stylesheets/bootstrap/_carousel.scss
@@ -1,3 +1,5 @@
@use "sass:math";

//
// Carousel
// --------------------------------------------------
Expand Down Expand Up @@ -244,16 +246,16 @@
.icon-next {
width: ($carousel-control-font-size * 1.5);
height: ($carousel-control-font-size * 1.5);
margin-top: ($carousel-control-font-size / -2);
margin-top: math.div($carousel-control-font-size, -2);
font-size: ($carousel-control-font-size * 1.5);
}
.glyphicon-chevron-left,
.icon-prev {
margin-left: ($carousel-control-font-size / -2);
margin-left: math.div($carousel-control-font-size, -2);
}
.glyphicon-chevron-right,
.icon-next {
margin-right: ($carousel-control-font-size / -2);
margin-right: math.div($carousel-control-font-size, -2);
}
}

Expand Down
6 changes: 4 additions & 2 deletions assets/stylesheets/bootstrap/_code.scss
@@ -1,3 +1,5 @@
@use "sass:math";

//
// Code (inline and block)
// --------------------------------------------------
Expand Down Expand Up @@ -40,8 +42,8 @@ kbd {
// Blocks of code
pre {
display: block;
padding: (($line-height-computed - 1) / 2);
margin: 0 0 ($line-height-computed / 2);
padding: math.div($line-height-computed - 1, 2);
margin: 0 0 math.div($line-height-computed, 2);
font-size: ($font-size-base - 1); // 14px to 13px
line-height: $line-height-base;
color: $pre-color;
Expand Down
4 changes: 3 additions & 1 deletion assets/stylesheets/bootstrap/_forms.scss
@@ -1,3 +1,5 @@
@use "sass:math";

//
// Forms
// --------------------------------------------------
Expand Down Expand Up @@ -581,7 +583,7 @@ textarea.form-control {
// Reposition the icon because it's now within a grid column and columns have
// `position: relative;` on them. Also accounts for the grid gutter padding.
.has-feedback .form-control-feedback {
right: floor(($grid-gutter-width / 2));
right: floor(math.div($grid-gutter-width, 2));
}

// Form group sizes
Expand Down
8 changes: 5 additions & 3 deletions assets/stylesheets/bootstrap/_jumbotron.scss
@@ -1,3 +1,5 @@
@use "sass:math";

//
// Jumbotron
// --------------------------------------------------
Expand All @@ -16,7 +18,7 @@
}

p {
margin-bottom: ($jumbotron-padding / 2);
margin-bottom: math.div($jumbotron-padding, 2);
font-size: $jumbotron-font-size;
font-weight: 200;
}
Expand All @@ -27,8 +29,8 @@

.container &,
.container-fluid & {
padding-right: ($grid-gutter-width / 2);
padding-left: ($grid-gutter-width / 2);
padding-right: math.div($grid-gutter-width, 2);
padding-left: math.div($grid-gutter-width, 2);
border-radius: $border-radius-large; // Only round corners at higher resolutions if contained in a container
}

Expand Down
4 changes: 3 additions & 1 deletion assets/stylesheets/bootstrap/_navbar.scss
@@ -1,3 +1,5 @@
@use "sass:math";

//
// Navbars
// --------------------------------------------------
Expand Down Expand Up @@ -228,7 +230,7 @@
// the nav the full height of the horizontal nav (above 768px).

.navbar-nav {
margin: ($navbar-padding-vertical / 2) (-$navbar-padding-horizontal);
margin: math.div($navbar-padding-vertical, 2) (-$navbar-padding-horizontal);

> li > a {
padding-top: 10px;
Expand Down
16 changes: 9 additions & 7 deletions assets/stylesheets/bootstrap/_type.scss
@@ -1,3 +1,5 @@
@use "sass:math";

//
// Typography
// --------------------------------------------------
Expand Down Expand Up @@ -25,7 +27,7 @@ h1, .h1,
h2, .h2,
h3, .h3 {
margin-top: $line-height-computed;
margin-bottom: ($line-height-computed / 2);
margin-bottom: math.div($line-height-computed, 2);

small,
.small {
Expand All @@ -35,8 +37,8 @@ h3, .h3 {
h4, .h4,
h5, .h5,
h6, .h6 {
margin-top: ($line-height-computed / 2);
margin-bottom: ($line-height-computed / 2);
margin-top: math.div($line-height-computed, 2);
margin-bottom: math.div($line-height-computed, 2);

small,
.small {
Expand All @@ -56,7 +58,7 @@ h6, .h6 { font-size: $font-size-h6; }
// -------------------------

p {
margin: 0 0 ($line-height-computed / 2);
margin: 0 0 math.div($line-height-computed, 2);
}

.lead {
Expand All @@ -77,7 +79,7 @@ p {
// Ex: (12px small font / 14px base font) * 100% = about 85%
small,
.small {
font-size: floor((100% * $font-size-small / $font-size-base));
font-size: floor(math.div(100% * $font-size-small, $font-size-base));
}

mark,
Expand Down Expand Up @@ -149,7 +151,7 @@ mark,
ul,
ol {
margin-top: 0;
margin-bottom: ($line-height-computed / 2);
margin-bottom: math.div($line-height-computed, 2);
ul,
ol {
margin-bottom: 0;
Expand Down Expand Up @@ -239,7 +241,7 @@ abbr[data-original-title] {

// Blockquotes
blockquote {
padding: ($line-height-computed / 2) $line-height-computed;
padding: math.div($line-height-computed, 2) $line-height-computed;
margin: 0 0 $line-height-computed;
font-size: $blockquote-font-size;
border-left: 5px solid $blockquote-border-color;
Expand Down
6 changes: 4 additions & 2 deletions assets/stylesheets/bootstrap/_variables.scss
@@ -1,3 +1,5 @@
@use "sass:math";

$bootstrap-sass-asset-helper: false !default;
//
// Variables
Expand Down Expand Up @@ -365,8 +367,8 @@ $container-lg: $container-large-desktop !default;
$navbar-height: 50px !default;
$navbar-margin-bottom: $line-height-computed !default;
$navbar-border-radius: $border-radius-base !default;
$navbar-padding-horizontal: floor(($grid-gutter-width / 2)) !default;
$navbar-padding-vertical: (($navbar-height - $line-height-computed) / 2) !default;
$navbar-padding-horizontal: floor(math.div($grid-gutter-width, 2)) !default;
$navbar-padding-vertical: math.div($navbar-height - $line-height-computed, 2) !default;
$navbar-collapse-max-height: 340px !default;

$navbar-default-color: #777 !default;
Expand Down
14 changes: 8 additions & 6 deletions assets/stylesheets/bootstrap/mixins/_grid-framework.scss
@@ -1,3 +1,5 @@
@use "sass:math";

// Framework grid generation
//
// Used only by Bootstrap to generate the correct number of grid classes given
Expand All @@ -13,8 +15,8 @@
// Prevent columns from collapsing when empty
min-height: 1px;
// Inner gutter via padding
padding-right: floor(($grid-gutter-width / 2));
padding-left: ceil(($grid-gutter-width / 2));
padding-right: floor(math.div($grid-gutter-width, 2));
padding-left: ceil(math.div($grid-gutter-width, 2));
}
}

Expand All @@ -33,12 +35,12 @@
@mixin calc-grid-column($index, $class, $type) {
@if ($type == width) and ($index > 0) {
.col-#{$class}-#{$index} {
width: percentage(($index / $grid-columns));
width: percentage(math.div($index, $grid-columns));
}
}
@if ($type == push) and ($index > 0) {
.col-#{$class}-push-#{$index} {
left: percentage(($index / $grid-columns));
left: percentage(math.div($index, $grid-columns));
}
}
@if ($type == push) and ($index == 0) {
Expand All @@ -48,7 +50,7 @@
}
@if ($type == pull) and ($index > 0) {
.col-#{$class}-pull-#{$index} {
right: percentage(($index / $grid-columns));
right: percentage(math.div($index, $grid-columns));
}
}
@if ($type == pull) and ($index == 0) {
Expand All @@ -58,7 +60,7 @@
}
@if ($type == offset) {
.col-#{$class}-offset-#{$index} {
margin-left: percentage(($index / $grid-columns));
margin-left: percentage(math.div($index, $grid-columns));
}
}
}
Expand Down
58 changes: 30 additions & 28 deletions assets/stylesheets/bootstrap/mixins/_grid.scss
@@ -1,122 +1,124 @@
@use "sass:math";

// Grid system
//
// Generate semantic grid columns with these mixins.

// Centered container element
@mixin container-fixed($gutter: $grid-gutter-width) {
padding-right: ceil(($gutter / 2));
padding-left: floor(($gutter / 2));
padding-right: ceil(math.div($gutter, 2));
padding-left: floor(math.div($gutter, 2));
margin-right: auto;
margin-left: auto;
@include clearfix;
}

// Creates a wrapper for a series of columns
@mixin make-row($gutter: $grid-gutter-width) {
margin-right: floor(($gutter / -2));
margin-left: ceil(($gutter / -2));
margin-right: floor(math.div($gutter, -2));
margin-left: ceil(math.div($gutter, -2));
@include clearfix;
}

// Generate the extra small columns
@mixin make-xs-column($columns, $gutter: $grid-gutter-width) {
position: relative;
float: left;
width: percentage(($columns / $grid-columns));
width: percentage(math.div($columns, $grid-columns));
min-height: 1px;
padding-right: ($gutter / 2);
padding-left: ($gutter / 2);
padding-right: math.div($gutter, 2);
padding-left: math.div($gutter, 2);
}
@mixin make-xs-column-offset($columns) {
margin-left: percentage(($columns / $grid-columns));
margin-left: percentage(math.div($columns, $grid-columns));
}
@mixin make-xs-column-push($columns) {
left: percentage(($columns / $grid-columns));
left: percentage(math.div($columns, $grid-columns));
}
@mixin make-xs-column-pull($columns) {
right: percentage(($columns / $grid-columns));
right: percentage(math.div($columns, $grid-columns));
}

// Generate the small columns
@mixin make-sm-column($columns, $gutter: $grid-gutter-width) {
position: relative;
min-height: 1px;
padding-right: ($gutter / 2);
padding-left: ($gutter / 2);
padding-right: math.div($gutter, 2);
padding-left: math.div($gutter, 2);

@media (min-width: $screen-sm-min) {
float: left;
width: percentage(($columns / $grid-columns));
width: percentage(math.div($columns, $grid-columns));
}
}
@mixin make-sm-column-offset($columns) {
@media (min-width: $screen-sm-min) {
margin-left: percentage(($columns / $grid-columns));
margin-left: percentage(math.div($columns, $grid-columns));
}
}
@mixin make-sm-column-push($columns) {
@media (min-width: $screen-sm-min) {
left: percentage(($columns / $grid-columns));
left: percentage(math.div($columns, $grid-columns));
}
}
@mixin make-sm-column-pull($columns) {
@media (min-width: $screen-sm-min) {
right: percentage(($columns / $grid-columns));
right: percentage(math.div($columns, $grid-columns));
}
}

// Generate the medium columns
@mixin make-md-column($columns, $gutter: $grid-gutter-width) {
position: relative;
min-height: 1px;
padding-right: ($gutter / 2);
padding-left: ($gutter / 2);
padding-right: math.div($gutter, 2);
padding-left: math.div($gutter, 2);

@media (min-width: $screen-md-min) {
float: left;
width: percentage(($columns / $grid-columns));
width: percentage(math.div($columns, $grid-columns));
}
}
@mixin make-md-column-offset($columns) {
@media (min-width: $screen-md-min) {
margin-left: percentage(($columns / $grid-columns));
margin-left: percentage(math.div($columns, $grid-columns));
}
}
@mixin make-md-column-push($columns) {
@media (min-width: $screen-md-min) {
left: percentage(($columns / $grid-columns));
left: percentage(math.div($columns, $grid-columns));
}
}
@mixin make-md-column-pull($columns) {
@media (min-width: $screen-md-min) {
right: percentage(($columns / $grid-columns));
right: percentage(math.div($columns, $grid-columns));
}
}

// Generate the large columns
@mixin make-lg-column($columns, $gutter: $grid-gutter-width) {
position: relative;
min-height: 1px;
padding-right: ($gutter / 2);
padding-left: ($gutter / 2);
padding-right: math.div($gutter, 2);
padding-left: math.div($gutter, 2);

@media (min-width: $screen-lg-min) {
float: left;
width: percentage(($columns / $grid-columns));
width: percentage(math.div($columns, $grid-columns));
}
}
@mixin make-lg-column-offset($columns) {
@media (min-width: $screen-lg-min) {
margin-left: percentage(($columns / $grid-columns));
margin-left: percentage(math.div($columns, $grid-columns));
}
}
@mixin make-lg-column-push($columns) {
@media (min-width: $screen-lg-min) {
left: percentage(($columns / $grid-columns));
left: percentage(math.div($columns, $grid-columns));
}
}
@mixin make-lg-column-pull($columns) {
@media (min-width: $screen-lg-min) {
right: percentage(($columns / $grid-columns));
right: percentage(math.div($columns, $grid-columns));
}
}
6 changes: 4 additions & 2 deletions assets/stylesheets/bootstrap/mixins/_nav-vertical-align.scss
@@ -1,9 +1,11 @@
@use "sass:math";

// Navbar vertical align
//
// Vertically center elements in the navbar.
// Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin.

@mixin navbar-vertical-align($element-height) {
margin-top: (($navbar-height - $element-height) / 2);
margin-bottom: (($navbar-height - $element-height) / 2);
margin-top: math.div($navbar-height - $element-height, 2);
margin-bottom: math.div($navbar-height - $element-height, 2);
}