{"id":26601223,"url":"https://github.com/iocss/crossass-mem","last_synced_at":"2026-04-09T21:56:45.959Z","repository":{"id":14620807,"uuid":"17338157","full_name":"iocss/crossass-mem","owner":"iocss","description":"A module-relative rem unit library for Sass (mixin / function).","archived":false,"fork":false,"pushed_at":"2014-03-23T16:56:04.000Z","size":168,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-11T22:31:44.964Z","etag":null,"topics":["css","font-size","function","functions","library","mixin","mixins","sass","unit"],"latest_commit_sha":null,"homepage":"","language":"CSS","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/iocss.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-02T13:28:11.000Z","updated_at":"2019-02-13T10:59:56.000Z","dependencies_parsed_at":"2022-08-31T03:01:16.312Z","dependency_job_id":null,"html_url":"https://github.com/iocss/crossass-mem","commit_stats":null,"previous_names":["whizark/crossass-mem"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iocss%2Fcrossass-mem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iocss%2Fcrossass-mem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iocss%2Fcrossass-mem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iocss%2Fcrossass-mem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iocss","download_url":"https://codeload.github.com/iocss/crossass-mem/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245152524,"owners_count":20569393,"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","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":["css","font-size","function","functions","library","mixin","mixins","sass","unit"],"created_at":"2025-03-23T18:38:02.265Z","updated_at":"2026-04-09T21:56:45.926Z","avatar_url":"https://github.com/iocss.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Crossass Mem\n\nA module-relative rem unit library (mixin / function) for Sass.\n\nEach HTML/CSS module can be separately scalable with Crossass Mem.\n\n```scss\n// Defines the HTML font-size for the base REM value\n@include x-config-set('x.mem.rem-base', 16px);\n\nhtml {\n    font-size: 16px;                        // 1Rem = 16px\n}\narticle {\n    // Defines the base MEM value for this module\n    @include x-mem-base(.75rem);            // 1Mem = .75Rem (12px)\n\n    font-size: x-mem-base-fallback();       // 12px the fallback below\n    font-size: x-mem-base();                // .75Rem = 1Mem (12px)\n\n    h1 {\n        font-size: x-mem-fallback(2)        // 24px: the fallback below\n        font-size: x-mem(2);                // 1.5Rem = .75Rem * 2Mem (24px)\n    }\n}\n```\n\n## Features\n\n* Module-relative rem value (MEM unit)\n* Fallbacks for legacy browsers (such as IE8)\n* Multiple and nestable base mem values\n\n## Em, rem problems\n\nNowaday, em and rem unit are widely used for building scalable Web.\nHowever they have a few problems with the scalability / modularity, especially with the font-sizing.\n\nUnit | Relative to    | Use case |\n--- | --- | --- |\nem | parent element | [em](http://jsfiddle.net/whizark/GA8hN/)\nrem | root (html) | [rem](http://jsfiddle.net/whizark/HT6UD/)\nmem | any | [mem](http://jsfiddle.net/whizark/hkR7z/)\n\nThe table below is a comparison table about the scalability against each kind of modification.\n\nUnit | Base font-size | Structure | Module font-sizing\n--- | --- | --- | --- | ---\nem   | [Good](http://jsfiddle.net/whizark/3LPb6/) | **[Poor](http://jsfiddle.net/whizark/8n7g8/)** | [Good](http://jsfiddle.net/whizark/2RHqp/)\nrem  | [Good](http://jsfiddle.net/whizark/mSPuD/) | [Good](http://jsfiddle.net/whizark/KcG86/) | **[Poor](http://jsfiddle.net/whizark/7Vhu7/)**\nmem  | [Good](http://jsfiddle.net/whizark/rrsME/) | [Good](http://jsfiddle.net/whizark/39dS8/) | [Good](http://jsfiddle.net/whizark/jyBtL/)\n\nWith Crossass Mem, you can easily/flexibly handle rem-based sizing.\n\n## Requirement\n\n* [Sass](http://sass-lang.com/) 3.3.0+\n\n## Installation\n\n```sh\nbower install crossass-mem\n```\n\nor just copy ```crossass-mem``` folder and ```crosass-config``` folder of [Crossass Configuration](https://github.com/whizark/crossass-config) into your project.\n\n## Usage\n\n### Import\n\n```scss\n@import 'bower_components/crossass-config/scss/config';\n@import 'bower_components/crossass-mem/scss/mem';\n```\n\nor\n\n```scss\n@import 'your-folder/crossass-config/scss/config';\n@import 'your-folder/crossass-mem/scss/mem';\n```\n\n### Configuration\n\n```scss\n// Defines the HTML font-size for the base REM value\n@include x-config-set('x.mem.rem-base', 16px);\n\nhtml {\n    font-size: 16px;  // This should be the same as `x.mem.rem-base` value\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiocss%2Fcrossass-mem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiocss%2Fcrossass-mem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiocss%2Fcrossass-mem/lists"}