{"id":24244431,"url":"https://github.com/unsass/rem","last_synced_at":"2026-03-10T11:31:54.322Z","repository":{"id":36953562,"uuid":"465079642","full_name":"unsass/rem","owner":"unsass","description":"Sass functions and mixins to use rem units.","archived":false,"fork":false,"pushed_at":"2025-12-10T22:09:17.000Z","size":900,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-11T09:36:21.165Z","etag":null,"topics":["convert","rem","sass"],"latest_commit_sha":null,"homepage":"https://unsass.dev/rem/getting-started.html","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/unsass.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-03-01T22:40:30.000Z","updated_at":"2025-12-10T22:02:50.000Z","dependencies_parsed_at":"2026-01-05T12:04:38.979Z","dependency_job_id":null,"html_url":"https://github.com/unsass/rem","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/unsass/rem","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unsass%2Frem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unsass%2Frem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unsass%2Frem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unsass%2Frem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unsass","download_url":"https://codeload.github.com/unsass/rem/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unsass%2Frem/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30332286,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T05:25:20.737Z","status":"ssl_error","status_checked_at":"2026-03-10T05:25:17.430Z","response_time":106,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["convert","rem","sass"],"created_at":"2025-01-14T22:19:22.624Z","updated_at":"2026-03-10T11:31:54.302Z","avatar_url":"https://github.com/unsass.png","language":"SCSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rem\n\n[![Version](https://flat.badgen.net/npm/v/@unsass/rem)](https://www.npmjs.com/package/@unsass/rem)\n[![Downloads](https://flat.badgen.net/npm/dt/@unsass/rem)](https://www.npmjs.com/package/@unsass/rem)\n[![License](https://flat.badgen.net/npm/license/@unsass/rem)](https://www.npmjs.com/package/@unsass/rem)\n\n## Introduction\n\nSass functions and mixins to use rem units.\n\n## Installing\n\n```shell\nnpm install @unsass/rem\n```\n\n## Usage\n\n```scss\n@use \"@unsass/rem\";\n\n.foo {\n    font-size: rem.convert(16px);\n}\n```\n\n### Configuration\n\n```scss\n@use \"@unsass/rem\" with (\n    $baseline: 10px\n);\n```\n\n### Options\n\n| Variable    | Default | Description                            |\n|-------------|---------|----------------------------------------|\n| `$baseline` | `16px`  | Sets baseline reference. Only in `px`. |\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($baseline)` | Override top-level `with` configuration. |\n\n#### Configuration rule with `rem.config()`\n\nThe following Sass will configure new parameters:\n\n```scss\n@use \"@unsass/rem\";\n\n@include rem.config(10px);\n```\n\n## API\n\n### Sass functions\n\n| Function              | Description                 |\n|-----------------------|-----------------------------|\n| `convert($values...)` | Convert `px` unit to `rem`. |\n\n#### Convert with `rem.convert()`\n\nThe following Sass...\n\n```scss\n@use \"@unsass/rem\";\n\n.foo {\n    font-size: rem.convert(16px); // Single value.\n    margin: rem.convert(20px 30px); // Multiple values.\n    border: rem.convert(1px solid darkcyan); // Multiple mixed values.\n    box-shadow: rem.convert(0 0 10px 5px rgba(darkcyan, 0.75), inset 0 0 10px 5px rgba(darkcyan, 0.75)); // Comma-separated values.\n}\n```\n\n...will produce the following CSS...\n\n```css\n.foo {\n    font-size: 1rem;\n    margin: 1.25rem 1.875rem;\n    border: 0.0625rem solid darkcyan;\n    box-shadow: 0 0 0.625rem 0.3125rem rgba(0, 139, 139, 0.75), inset 0 0 0.625rem 0.3125rem rgba(0, 139, 139, 0.75);\n}\n```\n\n### Sass mixins\n\n| Mixin                                        | Description                                                                         |\n|----------------------------------------------|-------------------------------------------------------------------------------------|\n| `baseline($important)`                       | Sets declaration with `font-size` property, with optional `!important`.             |\n| `declaration($property, $value, $important)` | Sets declaration with conversion of `px` unit to `rem`, with optional `!important`. |\n\n#### Convert declaration with `rem.declaration()`\n\nThe following Sass...\n\n```scss\n@use \"@unsass/rem\";\n\n.foo {\n    @include rem.declaration(font-size, 16px); // Single value.\n    @include rem.declaration(margin, 20px 30px); // Multiple values.\n    @include rem.declaration(border, 1px solid darkcyan); // Multiple mixed values.\n    @include rem.declaration(box-shadow, 0 0 10px 5px rgba(darkcyan, 0.75), inset 0 0 10px 5px rgba(darkcyan, 0.75)); // Comma-separated values.\n}\n```\n\n...will produce the following CSS...\n\n```css\n.foo {\n    font-size: 1rem;\n    margin: 1.25rem 1.875rem;\n    border: 0.0625rem solid darkcyan;\n    box-shadow: 0 0 0.625rem 0.3125rem rgba(0, 139, 139, 0.75), inset 0 0 0.625rem 0.3125rem rgba(0, 139, 139, 0.75);\n}\n```\n\n#### Baseline declaration with `rem.baseline()`\n\nThe following Sass...\n\n```scss\n@use \"@unsass/rem\";\n\nhtml,\nbody {\n    @include rem.baseline;\n}\n```\n\n...will produce the following CSS...\n\n```css\nhtml,\nbody {\n    font-size: 100%\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funsass%2Frem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funsass%2Frem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funsass%2Frem/lists"}