Releases: Threespot/frontline-sass
3.10.1
3.10
You can now specify $initial: false
to prevent fs-scale()
from outputting the initial value, which is not inside a media query. This was achieved in the old fs-scale()
mixin with $fallback: false
.
Example
.heading {
@include fs-scale(font-size, (1000px: 50px, 1200px: 70px), $initial: false);
}
Output
@media all and (min-width: 75em) {
.test {
font-size: calc(10vw + -3.125rem);
}
}
@media all and (min-width: 75em) {
.test {
font-size: 4.375rem;
}
}
3.9.1
3.9
New and improved inline SVG mixin and global variable
The new $fs-svgs
variable should contain the full SVG markup for each icon. No additional properties are required (e.g. heigh, width).
$fs-svgs: (
'chevDown': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 10" preserveAspectRatio="xMidYMid meet"><path d="M12 0l2 2-7 7.1-7-7L2-.1l5 5z"/></svg>'
);
The new fs-svg-url()
mixin supports multiple SVG attributes using a map:
.foo {
background-image: fs-svg-url('chevDown', (fill: none, stroke: red, stroke-width: 1px));
}
fs-scale()
mixin now supports map syntax
The fs-scale()
mixin now accepts a map for the breakpoints and values, inspired by poly-fluid-sizing
(see #14).
.foo {
@include fs-scale(font-size, (320px: 18px, 768px: 26px, 1024px: 38px));
}
.bar {
@include fs-scale(margin-bottom margin-top, (320px: 18px, 768px: 26px, 1024px: 38px));
}
We can now do in one line what used to require multiple lines and manually setting $fallback: false
:
Old Syntax
.title {
@include fs-scale(font-size, 18px, 26px, 320px, $bp-row - 1px);
@include fs-scale(font-size, 18px, 26px, $bp-row, 1000px, $fallback: false);
}
New Syntax
.title {
@include fs-scale(font-size, (
320px: 18px,
$bp-row - 1px: 26px,
$bp-row: 18px,
1000px: 26px
));
}
Note: The old syntax will still be supported until the next major release but you will see the following deprecation warning:
WARNING: Upgrade fs-scale() to new map syntax, fs-scale(font-size, (360px: 18px, 900px: 28px))
node_modules/frontline-sass/dist/_frontline.scss 2200:3 fs-scale-legacy()
node_modules/frontline-sass/dist/_frontline.scss 2170:5 fs-scale()
resources/assets/styles/mixins/_rich-text-headings.scss 29:3 h5()
resources/assets/styles/mixins/_richtext-mixin.scss 43:23 richtext()
resources/assets/styles/helpers/_universal-helpers.scss 12:16 @import
resources/assets/styles/main.scss 25:214 root stylesheet
Migration
You can use this RegEx formula to do a find-and-replace for the basic fs-scale()
usage (i.e. no $fallback
or multi-line support):
Find old syntax
@include fs-scale\(([\w\s-]+), ([\w\d$-]+), ([\w\d$-]+), ([\w\d$-]+), ([\w\d$-]+)\)
Replace with new syntax
@include fs-scale($1, ($4: $2, $5: $3))
3.8
v3.7.2
Scaling functions and mixins
Parent Pseudo Mixin
New Features
- Parent Pseudo Mixins - _pseudos-parent.scss
fs-static-parent
fs-attention-parent
fs-all-states-parent
Changes
- Rename
fs-strip
tofs-strip-unit
fs-strip
still exists and just callsfs-strip-unit