mirror of
https://github.com/tabler/tabler.git
synced 2026-08-08 04:12:26 +04:00
31 lines
1.0 KiB
SCSS
31 lines
1.0 KiB
SCSS
// Tests for the RFS (responsive font sizing) helper functions in
|
|
// scss/mixins/bootstrap/_rfs.scss. Both build their result via string
|
|
// concatenation, so they return unquoted strings (compared as strings here).
|
|
//
|
|
// `rfs-value` gives the static value (px normalised to rem); `rfs-fluid-value`
|
|
// gives the fluid value — unchanged below the base size, a responsive `calc()`
|
|
// above it.
|
|
|
|
@use '../mixins/bootstrap/rfs' as *;
|
|
|
|
@include describe('rfs-value') {
|
|
@include it('passes rem values through and keeps 0') {
|
|
@include assert-equal(rfs-value(2rem), '2rem');
|
|
@include assert-equal(rfs-value(0), '0');
|
|
}
|
|
|
|
@include it('normalises px to rem') {
|
|
@include assert-equal(rfs-value(20px), '1.25rem');
|
|
}
|
|
}
|
|
|
|
@include describe('rfs-fluid-value') {
|
|
@include it('leaves values at or below the base size unchanged') {
|
|
@include assert-equal(rfs-fluid-value(1rem), '1rem');
|
|
}
|
|
|
|
@include it('produces a responsive calc() above the base size') {
|
|
@include assert-equal(rfs-fluid-value(3rem), 'calc(1.425rem + 2.1vw)');
|
|
}
|
|
}
|