Research
Recent Trends in Malicious Packages Targeting Discord
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
@magnesium/theme
Advanced tools
Readme
Easily develop your Design System for the web, The Magnesium Sass Framework is here for that!
npm install @magnesium/theme
The theme component help you to easily manage theme styles with generate CSS custom properties declarations from user-provided theme's tokens map.
Option | Description |
---|---|
$prefix | Add global prefix name on any custom properties. Default mg . Set to false for disable. |
@use "@magnesium/theme" with (
$prefix: "foo" // Set to `false` for disabled.
);
emit-custom-props($theme, $prefix)
Emits CSS custom properties declarations from a user-provided theme's.
@use "@magnesium/theme";
$theme: (
"text-color": darkcyan
);
.foo {
@include theme.emit-custom-props($theme, "button");
}
.foo {
--mg-button-text-color: darkcyan;
}
emit-variable($theme, $token, $fallback, $prefix)
Emits CSS variable declaration from a user-provided theme's.
@use "@magnesium/theme";
$theme: (
"text-color": darkcyan
);
.foo {
color: theme.emit-variable($theme, "text-color", false, "button");
}
.foo {
color: var(--mg-button-text-color);
}
validation($reference, $tokens)
Validates a user-provided theme's token and throws an error if tokens are invalid.
@use "@magnesium/theme";
$reference: (
"text-color": darkcyan
);
$theme: (
"text-color": darkorange
);
$theme: theme.validation($reference, $theme); // Return `$theme` map if true or error if false.
If variables are already configured on top-level using @use ... with
, by another dependency for example, you can't use
this solution anymore, because the module can only be setup once, this is a Sass restriction with Module System, but
another solution exist for override the main configuration, with a mixin!
See official documentation about override configuration with mixins.
Mixin | Description |
---|---|
config($prefix) | Override top-level prefix configuration. |
theme.config()
The following Sass will configure new parameters:
@use "@magnesium/theme";
@include theme.config("fr");
FAQs
The Sass Framework for Web Design System.
We found that @magnesium/theme demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Research
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
Security News
Socket CEO Feross Aboukhadijeh joins a16z partners to discuss how modern, sophisticated supply chain attacks require AI-driven defenses and explore the challenges and solutions in leveraging AI for threat detection early in the development life cycle.
Security News
NIST's new AI Risk Management Framework aims to enhance the security and reliability of generative AI systems and address the unique challenges of malicious AI exploits.