{"id":19230287,"url":"https://github.com/mrloop/ember-material-modifier","last_synced_at":"2026-02-09T21:34:00.604Z","repository":{"id":37805821,"uuid":"454925784","full_name":"mrloop/ember-material-modifier","owner":"mrloop","description":"Lightweight emberjs material design integration","archived":false,"fork":false,"pushed_at":"2025-01-24T03:42:32.000Z","size":1088,"stargazers_count":1,"open_issues_count":12,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-23T17:55:29.133Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/mrloop.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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}},"created_at":"2022-02-02T20:31:18.000Z","updated_at":"2023-08-17T23:44:37.000Z","dependencies_parsed_at":"2023-12-16T01:24:21.377Z","dependency_job_id":"79480b29-6b55-4ca7-8dba-471db3ce0714","html_url":"https://github.com/mrloop/ember-material-modifier","commit_stats":{"total_commits":178,"total_committers":3,"mean_commits":"59.333333333333336","dds":0.550561797752809,"last_synced_commit":"0e9dd2a48add98ac140d0d368f3de1ffbe77ac3d"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/mrloop/ember-material-modifier","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrloop%2Fember-material-modifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrloop%2Fember-material-modifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrloop%2Fember-material-modifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrloop%2Fember-material-modifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrloop","download_url":"https://codeload.github.com/mrloop/ember-material-modifier/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrloop%2Fember-material-modifier/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29281968,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-09T19:05:41.198Z","status":"ssl_error","status_checked_at":"2026-02-09T19:05:37.449Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":[],"created_at":"2024-11-09T15:37:37.159Z","updated_at":"2026-02-09T21:34:00.591Z","avatar_url":"https://github.com/mrloop.png","language":"JavaScript","readme":"# ember-material-modifier\n\n[![Node CI](https://github.com/mrloop/ember-material-modifier/actions/workflows/ci.yml/badge.svg)](https://github.com/mrloop/ember-material-modifier/actions/workflows/ci.yml)\n[![npm version](https://img.shields.io/npm/v/ember-material-modifier.svg)](https://www.npmjs.com/package/ember-material-modifier)\n\nLightweight Ember.js \u003ca href=\"https://material.io/components?platform=web\" target=\"_blank\" rel=\"noopener noreferrer\"\u003ematerial design\u003c/a\u003e integration.\n\nAn Ember add-on for [Material Component for web](https://github.com/material-components/material-components-web/).\n\n## Compatibility\n\n* Ember.js v3.20 or above\n* Ember CLI v3.20 or above\n* Node.js v12 or above\n\n\n## Installation\n\n```\nember install ember-material-modifier\n```\n\n\n## Usage\n\nember-material-modifier is designed to be as minimal and unobtrusive as possible. It only downloads the JavaScript and CSS of google material design components that you use.\n\n### Button Example\n\nFor instance if you want to use `@material/button` install the package\n\n```sh\nnpm install @material/button\n```\n\nHave a look at the material design docs for the component  https://github.com/material-components/material-components-web/tree/master/packages/mdc-button. Then copy the example \u003ca href=\"https://github.com/material-components/material-components-web/tree/master/packages/mdc-button#text-button-example\" target=\"_blank\" rel=\"noopener noreferrer\"\u003ehtml\u003c/a\u003e to one of your templates.\n\n```hbs\n\u003cbutton class=\"mdc-button\"\u003e\n  \u003cspan class=\"mdc-button__ripple\"\u003e\u003c/span\u003e\n  \u003cspan class=\"mdc-button__focus-ring\"\u003e\u003c/span\u003e\n  \u003cspan class=\"mdc-button__label\"\u003eText Button\u003c/span\u003e\n\u003c/button\u003e\n```\n\nNext you add the `ember-material-modifier` modifier `{{material}}`\n\n```hbs\n\u003cbutton class=\"mdc-button\" {{material 'button'}}\u003e\n  \u003cspan class=\"mdc-button__ripple\"\u003e\u003c/span\u003e\n  \u003cspan class=\"mdc-button__focus-ring\"\u003e\u003c/span\u003e\n  \u003cspan class=\"mdc-button__label\"\u003eText Button\u003c/span\u003e\n\u003c/button\u003e\n```\n\nEvent listeners are added as usual\n\n```hbs\n\u003cbutton class=\"mdc-button\" {{material 'button'}} {{on 'click' this.handleButtonClicked}}\u003e\n  \u003cspan class=\"mdc-button__ripple\"\u003e\u003c/span\u003e\n  \u003cspan class=\"mdc-button__focus-ring\"\u003e\u003c/span\u003e\n  \u003cspan class=\"mdc-button__label\"\u003eText Button\u003c/span\u003e\n\u003c/button\u003e\n```\n\nIf you find yourself duplicating this HTML you can extract it to a component that suits your application.\n\n_app/components/mdc-button.hbs_\n```hbs\n\u003cbutton {{...attributes}} class=\"mdc-button\" {{material 'button'}} \u003e\n  \u003cspan class=\"mdc-button__ripple\"\u003e\u003c/span\u003e\n  \u003cspan class=\"mdc-button__focus-ring\"\u003e\u003c/span\u003e\n  \u003cspan class=\"mdc-button__label\"\u003e{{yield}}\u003c/span\u003e\n\u003c/button\u003e\n```\n\n_app/templates/application.hbs_\n```hbs\n\u003cMdcButton {{on 'click' this.handleButtonClicked}}/\u003eText Button\u003c/MdcButton\u003e\n```\n\n| :warning: WARNING          |\n|:---------------------------|\n| Many of the material.io HTML examples use the [Material Icons google font](https://fonts.google.com/icons?selected=Material+Icons), you either need to [install the font](https://developers.google.com/fonts/docs/material_icons#setup_method_1_using_via_google_fonts) or edit the example HTML to use an [alternative](https://github.com/ivanvotti/ember-svg-jar). |\n\n\n### Register component\n\nThe `{{material}}` modifier takes two positional arguments. The first is the name of the material design component. For instance you want to use the package `@material/menu` then the modifier is `{{material 'menu'}}`. You can also pass a second arguement to register the instance of material design component class with your application code.\n\n\n```hbs\n\u003cdiv\n  class=\"mdc-menu mdc-menu-surface\"\n  {{material 'menu' this.registerMaterialMenu}}\n\u003e\n```\n\n```js\n@action\nregisterMaterialMenu(mdcMenu) {\n  this.mdcMenu = mdcMenu;\n}\n```\n\nYou now have access to the \u003ca href=\"https://material.io/components/menus/web#span-class-inline-code-mdcmenu-span-properties-and-methods\" target=\"_blank\" rel=\"noopener noreferrer\"\u003eMDCMenu properites and methods\u003c/a\u003e.\n\n### Custom Events\n\nMany on the material design components emit custom events. You can add event listeners for these as you would any other event.\n\n```hbs\n\u003cul\n  class=\"mdc-list\"\n  {{material 'list'}}\n  {{on 'MDCList:action' this.handleMdcListItemSelected}}\n\u003e\n  \u003cli class=\"mdc-list-item\" tabindex=\"0\"\u003e\n    \u003cspan class=\"mdc-list-item__ripple\"\u003e\u003c/span\u003e\n    \u003cspan class=\"mdc-list-item__text\"\u003eItem 1 - Division 1\u003c/span\u003e\n  \u003c/li\u003e\n\u003c/ul\u003e\n```\n\nThough in the case of a list item being selected you probably want to use a standard 'click' event listener on the specific list item.\n\n```hbs\n\u003cul\n  class=\"mdc-list\"\n  {{material 'list'}}\n\u003e\n  \u003cli\n    class=\"mdc-list-item\" tabindex=\"0\"\n    {{on 'click' this.handleMdcListItemSelected}}\n  \u003e\n    \u003cspan class=\"mdc-list-item__ripple\"\u003e\u003c/span\u003e\n    \u003cspan class=\"mdc-list-item__text\"\u003eItem 1 - Division 1\u003c/span\u003e\n  \u003c/li\u003e\n\u003c/ul\u003e\n```\n\n### Theming\n\nGoogle material design components can be themed using CSS variables.\n\nYou can find a list of CSS variables in the google style sheets. For instance if you install any of the `@material/*` packages they have a dependencies on `@material/theme`. You can open `./node_modules/@material/theme/dist/mdc.theme.css` which gives a list of CSS variables.\n\nFor example to change the primary text color add the following to your `app.css`\n\n_app.css_\n```css\n:root {\n  --mdc-theme-text-primary-on-background: purple;\n};\n```\n\nYou can use the \u003ca href=\"https://material.io/resources/color\" target=\"_blank\" rel=\"noopener noreferrer\"\u003ecolor tool\u003c/a\u003e to preview material design themes.\n\n\n### CSS Loading\n\nThe CSS is lazy loaded when the material design components class is instantiated. It is loaded when the modifier is run after the HTML has been rendered. If it is the first time the material design component has been loaded there will be a noticeable delay until the CSS is applied, you will see the component unstyled.\n\nTo prevent this you can eager load the CSS for the material design components you use in the application router. For instance if you use `{{material 'button'}}` in one of your templates add `importCss('button')` to the beforeModel hook of your application route.\n\n_app/controller/application.js_\n```js\nimport Route from '@ember/routing/route';\n\nimport importCss from 'ember-material-modifier/import-css';\n\nexport default class ApplicationRoute extends Route {\n  beforeModel() {\n    return importCss('button');\n  }\n}\n```\n\nIt should be possible to remove this `importCss` and eager load the needed material design CSS without it. The need to call `importCss` will hopefully be removed.\n\n\n## Contributing\n\nSee the [Contributing](CONTRIBUTING.md) guide for details.\n\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE.md).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrloop%2Fember-material-modifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrloop%2Fember-material-modifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrloop%2Fember-material-modifier/lists"}