{"id":18879370,"url":"https://github.com/austinsc/react-style-decorator","last_synced_at":"2025-08-01T14:13:00.941Z","repository":{"id":57345863,"uuid":"49897370","full_name":"austinsc/react-style-decorator","owner":"austinsc","description":"ES7 decorator for attaching stylesheets to a component's lifecycle.","archived":false,"fork":false,"pushed_at":"2019-07-01T13:31:43.000Z","size":22,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-31T06:25:11.295Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/austinsc.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-18T18:46:34.000Z","updated_at":"2019-07-01T13:31:45.000Z","dependencies_parsed_at":"2022-09-17T06:23:23.626Z","dependency_job_id":null,"html_url":"https://github.com/austinsc/react-style-decorator","commit_stats":null,"previous_names":["rovisys/react-style-decorator"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/austinsc/react-style-decorator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austinsc%2Freact-style-decorator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austinsc%2Freact-style-decorator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austinsc%2Freact-style-decorator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austinsc%2Freact-style-decorator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/austinsc","download_url":"https://codeload.github.com/austinsc/react-style-decorator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austinsc%2Freact-style-decorator/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268241108,"owners_count":24218374,"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-08-01T02:00:08.611Z","response_time":67,"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":[],"created_at":"2024-11-08T06:35:37.847Z","updated_at":"2025-08-01T14:13:00.902Z","avatar_url":"https://github.com/austinsc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](http://img.shields.io/travis/RoviSys/react-style-decorator.svg?style=flat)](https://travis-ci.org/RoviSys/react-style-decorator)\n[![Code Climate](https://codeclimate.com/github/RoviSys/react-style-decorator/badges/gpa.svg)](https://codeclimate.com/github/RoviSys/react-style-decorator)\n[![Test Coverage](https://codeclimate.com/github/RoviSys/react-style-decorator/badges/coverage.svg)](https://codeclimate.com/github/RoviSys/react-style-decorator)\n[![Dependency Status](https://david-dm.org/RoviSys/react-style-decorator.svg)](https://david-dm.org/RoviSys/react-style-decorator)\n[![devDependency Status](https://david-dm.org/RoviSys/react-style-decorator/dev-status.svg)](https://david-dm.org/RoviSys/react-style-decorator#info=devDependencies)\n\n# react-style-decorator\n\n \u003e ES7 decorator for attaching a reffable style to the component lifecycle.\n\n## Installation\n\nRun `npm install --save react-style-decorator` and then use the default export of the module.\n\n## Purpose\n\nThe purpose of the module is to provide an easy way to attach a reffable style to a component lifecyle.\n\n## Example \n \nUsing the style decorator, you can attatch a stylesheet to a component like this:\n\n```javascript\nimport Style from 'react-style-decorator';\n\n@Style(require('css/my-component.css'))\nclass MyComponent extends Component {\n  render() {\n    return (\n      \u003ch1\u003eExample\u003ch1\u003e\n    );\n  }\n}\n```\n\nThe above example assumes that you are using webpack's [style-loader](https://github.com/webpack/style-loader) with the `/usable` option. This converts the stylesheet into a javascript module that has a reference counting feature. [Click here](https://github.com/webpack/style-loader#reference-counted-api) for more information about the reference counting feature.\n\nThis decorator also supports variadic style arguments, so you can pass as many stylesheets into the decorator that you want:\n\n```javascript\nimport Style from 'react-style-decorator';\n\n@Style(require('css/my-component1.css'), require('css/my-component2.css'), require('css/my-component3.css'))\nclass MyComponent extends Component {\n  render() {\n    return (\n      \u003ch1\u003eExample\u003ch1\u003e\n    );\n  }\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faustinsc%2Freact-style-decorator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faustinsc%2Freact-style-decorator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faustinsc%2Freact-style-decorator/lists"}