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-spacing
Advanced tools
Little Miss Robot spacing setup for defining spacing variables
This repository contains the logic and functionality to define and insert consistent spacings based on an iteratable amount.
This repository does not generate any CSS. It simply makes functions and mixins available to be used in combination with a configuration object to manage your spacing.
$ npm install --save-dev @littlemissrobot/sass-spacing
@import
// Dependency
"@littlemissrobot/sass-functions/lib/main",
// Library
"@littlemissrobot/sass-spacing/lib/main";
$lmr-sass-spacing: (
settings: (
baseline: 1rem,
),
source: (
x1: 1,
x2: 2,
x3: 3,
x4: 4,
x5: 5,
x6: 6,
x7: 7,
micro: 1rem,
tiny: 2rem,
small: 3rem,
base: 4rem,
large: 5rem,
huge: 6rem,
giant: 7rem
)
);
There are two ways to add keys to the source:
Passing a number without a unit will make use of the baseline defined in the settings key. The number will be multiplied with the baseline value to define a certain spacing. You can give you iterator a name to make it contextual or reusable.
For example:
$lmr-sass-spacing: (
settings: (
baseline: 1rem,
),
source: (
1x: 1, // 1rem
2x: 2 // 2rem
)
);
Passing a number with a unit will simply ignore the baseline and make use of the value you have passed to the key.
For example:
$lmr-sass-spacing: (
settings: (
baseline: 1rem,
),
source: (
micro: 2.5rem, // 2.5rem
giant: 70px // 70px
)
);
The set-spacing function accepts a path that it will follow and will look through the source defined in the $lmr-sass-spacing map and retrieve the value from the passed path.
Parameters:
path: The path to the spacing value in the source
key of the map
$lmr-sass-spacing. It accepts the formats:
"section small"
(we like this)"section" "small"
("section", "small")
// =============================================================================
// Configuration
// =============================================================================
$lmr-sass-colors: (
settings: (
baseline: 1rem
),
source: (
section: (
small: 1rem, // 1rem
base: 5, // 5rem
large: 9rem // 9rem
)
)
);
// =============================================================================
// Examples
// =============================================================================
// As a string
// -----------------------------------------------------------------------------
div {
margin-top: set-color("section small");
margin-top: set-color("section base");
}
// As a list of space-separated strings
// -----------------------------------------------------------------------------
div {
margin-top: set-color("section" "small");
margin-top: set-color("section" "base");
}
// As a list of comma-separated strings
// -----------------------------------------------------------------------------
div {
margin-top: set-color(("section", "small"));
margin-top: set-color(("section", "base"));
}
FAQs
Little Miss Robot spacing setup for defining spacing variables.
The npm package @littlemissrobot/sass-spacing receives a total of 47 weekly downloads. As such, @littlemissrobot/sass-spacing popularity was classified as not popular.
We found that @littlemissrobot/sass-spacing 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.