Skip to content

Набор функций и хелперов для sass/scss

Notifications You must be signed in to change notification settings

studio107/flexy-functions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

flexy-join

@include assert-equal(flexy-join((1 2 3)), '1 2 3');
@include assert-equal(flexy-join((1,2,3)), '1,2,3');
@include assert-equal(flexy-join((1 2 3), ', '), '1, 2, 3');

flexy-reverse

@include assert-equal(flexy-reverse((a b (c d e) f g h)), (h g f (c d e) b a));
@include assert-equal(flexy-reverse((a, b, (c, d, e), f, g, h)), (h, g, f, (c, d, e), b, a));

flexy-strip-unit

@include assert-equal(flexy-strip-unit(10px), 10);
@include assert-equal(flexy-strip-unit(10em), 10);
@include assert-equal(flexy-strip-unit(10rem), 10);
@include assert-equal(flexy-strip-unit(10pt), 10);
@include assert-equal(flexy-strip-unit(10vh), 10);
@include assert-equal(flexy-strip-unit(10vw), 10);

flexy-to-em

@include assert-equal(flexy-to-em(16px, 16px), 1em);
@include assert-equal(flexy-to-em(14px, 16px), 0.875em);
@include assert-equal(flexy-to-em(1rem, 16px), 1em);
@include assert-equal(flexy-to-em(2rem, 16px), 2em);
@include assert-equal(flexy-to-em(2pt, 16px), 0.125em);

flexy-map-next-key, flexy-map-prev-key

$map: (foo: 1, bar: 2);

@include assert-equal(flexy-map-next-key($map, foo), bar);
@include assert-equal(flexy-map-prev-key($map, bar), foo);

flexy-to-string

@include assert-equal(flexy-to-string(1), "1");
@include assert-equal(flexy-to-string(-1), "-1");

flexy-to-int

@include assert-equal(flexy-to-int("123"), 123);
@include assert-equal(flexy-to-int(123), 123);
@include assert-equal(flexy-to-int("-12"), -12);
@include assert-equal(flexy-to-int("-12.5"), -12.5);
@include assert-equal(flexy-to-int("12.5"), 12.5);

flexy-media-get

@include assert-equal(flexy-media-get((min-width: 100px, max-width: 101px)), '(max-width: 101px) and (min-width: 100px)');

flexy-media

@include flexy-media((min-width: 100px), 'only print') {
  font-size: 2rem;
}

result:

@media only print and (min-width: 100px) {
  font-size: 2rem;
}

About

Набор функций и хелперов для sass/scss

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published