{"id":30491729,"url":"https://github.com/magnesiumlabs/magnesium","last_synced_at":"2025-09-02T04:46:05.464Z","repository":{"id":36964292,"uuid":"426150546","full_name":"magnesiumlabs/magnesium","owner":"magnesiumlabs","description":"The Sass Framework for Web Design System.","archived":false,"fork":false,"pushed_at":"2025-08-23T22:51:08.000Z","size":3342,"stargazers_count":2,"open_issues_count":11,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-24T22:06:49.930Z","etag":null,"topics":["design-system","framework","sass","theme"],"latest_commit_sha":null,"homepage":"https://magnesium.design","language":"SCSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/magnesiumlabs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-11-09T08:36:11.000Z","updated_at":"2025-08-23T16:56:23.000Z","dependencies_parsed_at":"2024-04-17T09:42:04.627Z","dependency_job_id":"4cb75fbc-41c2-44b4-a856-2d98bc330ca6","html_url":"https://github.com/magnesiumlabs/magnesium","commit_stats":null,"previous_names":[],"tags_count":93,"template":false,"template_full_name":null,"purl":"pkg:github/magnesiumlabs/magnesium","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magnesiumlabs%2Fmagnesium","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magnesiumlabs%2Fmagnesium/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magnesiumlabs%2Fmagnesium/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magnesiumlabs%2Fmagnesium/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/magnesiumlabs","download_url":"https://codeload.github.com/magnesiumlabs/magnesium/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magnesiumlabs%2Fmagnesium/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273233276,"owners_count":25068731,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-02T02:00:09.530Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["design-system","framework","sass","theme"],"created_at":"2025-08-24T19:27:43.302Z","updated_at":"2025-09-02T04:46:05.439Z","avatar_url":"https://github.com/magnesiumlabs.png","language":"SCSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n![Magnesium Design](.github/banner.svg)\n\n\u003c/div\u003e\n\n[![Version](https://flat.badgen.net/npm/v/@magnesium/theme)](https://www.npmjs.com/package/@magnesium/theme)\n[![Downloads](https://flat.badgen.net/npm/dt/@magnesium/theme)](https://www.npmjs.com/package/@magnesium/theme)\n[![License](https://flat.badgen.net/npm/license/@magnesium/theme)](https://www.npmjs.com/package/@magnesium/theme)\n\n## Introduction\n\nThe Magnesium Sass Framework helps you easily develop your Web Design System.\n\n## Installing\n\n```shell\nnpm install @magnesium/theme\n```\n\n## Usage\n\nThe theme component help you to easily manage theme styles with generate CSS custom properties declarations from\nuser-provided theme's tokens map.\n\n## Options\n\n| Option    | Description                                                                                |\n|-----------|--------------------------------------------------------------------------------------------|\n| `$prefix` | Add global prefix name on any custom properties. Default `mg`. Set to `false` for disable. |\n\n```scss\n@use \"@magnesium/theme\" with (\n    $prefix: \"foo\" // Set to `false` for disabled.\n);\n```\n\n## Mixins\n\n### `emit-custom-props($tokens, $prefix)`\n\nEmits CSS custom properties declarations from a user-provided theme's.\n\n```scss\n@use \"@magnesium/theme\";\n\n$tokens: (\n    \"text-color\": darkcyan\n);\n\n.foo {\n    @include theme.emit-custom-props($tokens, \"button\");\n}\n```\n\n### Result\n\n```scss\n.foo {\n    --mg-button-text-color: darkcyan;\n}\n```\n\n## Functions\n\n### `emit-variable($tokens, $token, $fallback, $prefix)`\n\nEmits CSS variable declaration from a user-provided theme's.\n\n```scss\n@use \"@magnesium/theme\";\n\n$tokens: (\n    \"text-color\": darkcyan\n);\n\n.foo {\n    color: theme.emit-variable($tokens, \"text-color\", false, \"button\");\n}\n```\n\n### Result\n\n```css\n.foo {\n    color: var(--mg-button-text-color);\n}\n```\n\n### `validation($reference, $tokens)`\n\nValidates a user-provided theme's token and throws an error if tokens are invalid.\n\n```scss\n@use \"@magnesium/theme\";\n\n$reference: (\n    \"text-color\": darkcyan\n);\n\n$tokens: (\n    \"text-color\": darkorange\n);\n\n$tokens: theme.validation($reference, $tokens); // Return `$tokens` map if true or error if false.\n```\n\n## Top-level config override\n\nIf variables are already configured on top-level using `@use ... with`, by another dependency for example, you can't use\nthis solution anymore, because the module can only be setup once, this is a Sass restriction with **Module System**, but\nanother solution exist for override the main configuration, with a mixin!\n\nSee [official documentation](https://sass-lang.com/documentation/at-rules/use#with-mixins) about override configuration\nwith mixins.\n\n| Mixin             | Description                                |\n|-------------------|:-------------------------------------------|\n| `config($prefix)` | Override top-level `prefix` configuration. |\n\n#### Configuration rule with `theme.config()`\n\nThe following Sass will configure new parameters:\n\n```scss\n@use \"@magnesium/theme\";\n\n@include theme.config(\"fr\");\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagnesiumlabs%2Fmagnesium","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmagnesiumlabs%2Fmagnesium","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagnesiumlabs%2Fmagnesium/lists"}