Add and apply function-calculation-no-interpolation rule
This stylelint-scss rule is useful because we were inconsistent when
using calc(); sometimes we added interpolation to Sass variables, and
sometimes we didn't. The reason why we originally added interpolation
was that it was necessary until we migrated to Dart Sass in commit
d54971e53. Since then, we can omit the interpolation, which is also what
the Sass documentation recommends [1].
[1] https://sass-lang.com/documentation/values/calculations/
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
margin: $line-height 0;
|
||||
|
||||
@include breakpoint(medium) {
|
||||
margin: calc(#{$line-height} / 2) 0 0;
|
||||
margin: calc($line-height / 2) 0 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,11 +13,11 @@
|
||||
background: $highlight;
|
||||
clear: both;
|
||||
margin: $line-height 0;
|
||||
padding: calc(#{$line-height} / 2);
|
||||
padding: calc($line-height / 2);
|
||||
|
||||
.filter {
|
||||
display: inline-block;
|
||||
margin: 0 calc(#{$line-height} / 2);
|
||||
margin: 0 calc($line-height / 2);
|
||||
|
||||
label {
|
||||
font-weight: normal;
|
||||
@@ -26,7 +26,7 @@
|
||||
}
|
||||
|
||||
.button {
|
||||
margin-top: calc(#{$line-height} / 2);
|
||||
margin-top: calc($line-height / 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
.button {
|
||||
&.upload-image {
|
||||
margin-bottom: calc(#{$line-height} / 2);
|
||||
margin-bottom: calc($line-height / 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
dd {
|
||||
flex-basis: 20em;
|
||||
flex-grow: 1;
|
||||
max-width: calc(#{$global-width} * 3 / 4);
|
||||
max-width: calc($global-width * 3 / 4);
|
||||
}
|
||||
|
||||
+ * {
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
}
|
||||
|
||||
.callout {
|
||||
flex-basis: calc(#{$global-width} / 3);
|
||||
flex-basis: calc($global-width / 3);
|
||||
flex-grow: 1;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
.button {
|
||||
&.upload-image {
|
||||
margin-bottom: calc(#{$line-height} / 2);
|
||||
margin-bottom: calc($line-height / 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
align-items: flex-start;
|
||||
|
||||
+ * {
|
||||
margin-top: calc(#{$line-height} / 2);
|
||||
margin-top: calc($line-height / 2);
|
||||
}
|
||||
|
||||
.edit-link,
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
color: $admin-text;
|
||||
margin-bottom: $line-height;
|
||||
padding: $padding;
|
||||
padding-right: calc(2 * #{$padding} + #{$quote-width});
|
||||
padding-right: calc(2 * $padding + $quote-width);
|
||||
position: relative;
|
||||
|
||||
@include breakpoint(medium) {
|
||||
@@ -34,9 +34,9 @@
|
||||
}
|
||||
|
||||
&::after {
|
||||
bottom: calc(#{$padding} / 2);
|
||||
bottom: calc($padding / 2);
|
||||
color: $white;
|
||||
position: absolute;
|
||||
right: calc(#{$padding} + #{$quote-padding});
|
||||
right: calc($padding + $quote-padding);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
@each $size, $headers in $header-styles {
|
||||
@include breakpoint($size) {
|
||||
font-size: calc(#{rem-calc(map-get(map-get($headers, h2), font-size)) + rem-calc(map-get(map-get($headers, h3), font-size))} / 2);
|
||||
font-size: calc((rem-calc(map-get(map-get($headers, h2), font-size)) + rem-calc(map-get(map-get($headers, h3), font-size))) / 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
display: inline-block;
|
||||
font-size: $small-font-size;
|
||||
font-weight: bold;
|
||||
padding: calc(#{$line-height} / 2) $line-height * 3 0;
|
||||
padding: calc($line-height / 2) $line-height * 3 0;
|
||||
text-transform: uppercase;
|
||||
|
||||
&::before {
|
||||
@@ -17,7 +17,7 @@
|
||||
border-radius: 50%;
|
||||
content: "";
|
||||
height: 20px;
|
||||
margin-left: calc(#{$line-height} / 2);
|
||||
margin-left: calc($line-height / 2);
|
||||
position: absolute;
|
||||
top: -8px;
|
||||
width: 20px;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
&::after {
|
||||
content: "";
|
||||
display: block;
|
||||
margin-bottom: calc(#{$line-height} / 3);
|
||||
margin-bottom: calc($line-height / 3);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
> [type="hidden"] + fieldset,
|
||||
> fieldset + fieldset {
|
||||
@include admin-fieldset-separator;
|
||||
padding-top: calc(#{$line-height} / 4);
|
||||
padding-top: calc($line-height / 4);
|
||||
}
|
||||
|
||||
.collection-radio-buttons,
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
@each $elements in 10, 15, 20, 25, 30 {
|
||||
&:has(label:nth-of-type(#{$elements})) {
|
||||
column-count: calc(#{$elements} / 5);
|
||||
column-count: calc($elements / 5);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
}
|
||||
|
||||
form {
|
||||
max-width: calc(#{$global-width} * 3 / 4);
|
||||
max-width: calc($global-width * 3 / 4);
|
||||
}
|
||||
|
||||
select {
|
||||
|
||||
@@ -122,8 +122,8 @@
|
||||
li {
|
||||
ul {
|
||||
border-left: 1px solid $sidebar-hover;
|
||||
margin-left: calc(#{$line-height * 2} / 3);
|
||||
padding-left: calc(#{$line-height} / 2);
|
||||
margin-left: calc($line-height * 2 / 3);
|
||||
padding-left: calc($line-height / 2);
|
||||
}
|
||||
|
||||
&.is-active a,
|
||||
@@ -137,7 +137,7 @@
|
||||
li > :first-child {
|
||||
color: inherit;
|
||||
display: block;
|
||||
padding: calc(#{$line-height} / 2);
|
||||
padding: calc($line-height / 2);
|
||||
vertical-align: top;
|
||||
|
||||
&:hover {
|
||||
@@ -172,11 +172,11 @@
|
||||
margin-left: $line-height;
|
||||
|
||||
li:first-child {
|
||||
padding-top: calc(#{$line-height} / 2);
|
||||
padding-top: calc($line-height / 2);
|
||||
}
|
||||
|
||||
li:last-child {
|
||||
padding-bottom: calc(#{$line-height} / 2);
|
||||
padding-bottom: calc($line-height / 2);
|
||||
}
|
||||
|
||||
a {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
container-type: inline-size;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: calc(#{$line-height} / 2);
|
||||
gap: calc($line-height / 2);
|
||||
|
||||
> :first-child {
|
||||
align-items: flex-start;
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
|
||||
.radio-and-label {
|
||||
display: flex;
|
||||
margin-bottom: calc(#{$line-height} / 3);
|
||||
margin-bottom: calc($line-height / 3);
|
||||
|
||||
&:last-of-type {
|
||||
margin-bottom: calc(#{$line-height * 2} / 3);
|
||||
margin-bottom: calc($line-height * 2 / 3);
|
||||
}
|
||||
|
||||
input {
|
||||
|
||||
Reference in New Issue
Block a user