Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
@littlemissrobot/sass-functions
Advanced tools
Little Miss Robot sass functions library that helps execute reusable and complex tasks
This repository contains SASS functions that we, at Little Miss Robot, like to use to make our wonderful lives in the world of SASS easier and more managable.
This package contains no styling but simply provides a couple of functions that execute a simple task. This is specifically made for SASS and cannot be used in any other language.
$ npm install --save-dev @littlemissrobot/sass-functions
@import "~@littlemissrobot/sass-functions/lib/main";
Escapes special characters in SASS to be used in for example, class names. It places backward slashes in front of the special characters to escape them.
Supported characters (will get extended):
Parameters:
escape-chars("100%");
Checks if the passed value is a number and returns a boolean.
Parameters:
is-number($value);
Checks if a list contains a certain item and returns a boolean.
Parameters:
$list: (1, 2, 3);
$item: 1;
list-contains($list, $item);
The standard map-merge function only lets you merge 2 maps together. This function makes use of map-merge but merges as much maps together as you want.
Parameters
map-collect($map1, $map2, $map3);
Convert a pixel value to a rem value. Do note that we assume here that on the html tag you have defined that the font-size is 62.5%, to make sure that the 1rem is equal to 10px. If you want to overwrite this than you can simply pass a second parameter that indicates how much 1rem is in pixels.
Parameters:
margin: px-to-rem(50px);
Generate a random number between a minimum and maximum value. This returns a randomised number between the range.
Parameters:
margin: random-number(2rem, 10rem);
margin: random-number(20px, 100px);
Convert a rem value to a pixel value. Do note that we assume here that on the html tag you have defined that the font-size is 62.5%, to make sure that the 1rem is equal to 10px. If you want to overwrite this than you can simply pass a second parameter that indicates how much 1rem is in pixels.
Parameters:
margin: rem-to-px(5rem);
Reverses the order of the keys in a map
Parameters
reverse-map($breakpoints);
Converts any value into a pixel, only if it is supported within the function.
Supported values (get expanded):
Parameters
reverse-map($breakpoints);
Searches a string for a certain character or group of characters and replaces it with the passed character(s).
Parameters:
str-replace("Drupal 4 life", "Drupal", "Craft");
Create a list from a string by defining a character to split the string at.
Parameters:
$string: "Batman Superman Flash";
$separator: " ";
str-split($string, $separator);
Removes the unit from a value. For example: 10px becomes 10.
Parameters:
strip-unit(10px);
Converts a value to a string
Parameters:
to-string(10)
Trims a map to a certain target key. Returns a new map that is trimmed down until the key is met.
Parameters:
trim-map-to($breakpoints, "viewport-9");
Trims a map to a certain target key. Reverses the map to start from the top and goes down to the bottom. It trims the keys until the target is met.
Parameters:
trim-reverse-map-to($breakpoints, "viewport-9");
FAQs
Little Miss Robot sass functions library that helps execute reusable and complex tasks.
The npm package @littlemissrobot/sass-functions receives a total of 55 weekly downloads. As such, @littlemissrobot/sass-functions popularity was classified as not popular.
We found that @littlemissrobot/sass-functions demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.