{"id":16490197,"url":"https://github.com/jschr/react-style-side-effect","last_synced_at":"2026-06-07T01:32:09.222Z","repository":{"id":148931240,"uuid":"68836428","full_name":"jschr/react-style-side-effect","owner":"jschr","description":"React components to style html, body and root app elements. ","archived":false,"fork":false,"pushed_at":"2016-09-22T18:21:50.000Z","size":6,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-11T20:32:27.953Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jschr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2016-09-21T16:29:04.000Z","updated_at":"2018-05-26T11:36:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"48a8ac7c-03c1-451c-b849-8502bf120b72","html_url":"https://github.com/jschr/react-style-side-effect","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jschr%2Freact-style-side-effect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jschr%2Freact-style-side-effect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jschr%2Freact-style-side-effect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jschr%2Freact-style-side-effect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jschr","download_url":"https://codeload.github.com/jschr/react-style-side-effect/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241325504,"owners_count":19944378,"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":[],"created_at":"2024-10-11T13:46:58.085Z","updated_at":"2025-03-01T06:21:41.421Z","avatar_url":"https://github.com/jschr.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"React Style Side Effect\n=========================\n\n[![npm](https://img.shields.io/npm/v/react-style-side-effect.svg?style=flat-square)](https://www.npmjs.com/package/react-style-side-effect)\n\nDeclaritvely style elements that exist outside of the React tree. Works great with css-in-js libraries such as:\n- [aphrodite](https://github.com/Khan/aphrodite)\n\n## Installation\n\n```\nnpm install --save react-style-side-effect\n```\n\n## Basic Usage\n\n```js\nimport React from 'react'\nimport createStyleSideEffect from 'react-style-side-effect'\n\nconst HtmlStyle = createStyleSideEffect(document.docElement)\nconst BodyStyle = createStyleSideEffect(document.body)\nconst RootStyle = createStyleSideEffect(document.getElementById('root'))\n\nexport default function MyApp() {\n  return (\n    \u003cHtmlStyle className='htmlClass'\u003e\n      \u003cBodyStyle className='bodyClass'\u003e\n        \u003cRootStyle className='rootClass'\u003e\n          ...\n        \u003c/RootStyle\u003e\n      \u003c/BodyStyle\u003e\n    \u003c/HtmlStyle\u003e\n  )\n}\n```\n\n## Usage with Aphrodite\n\n```js\nimport React from 'react'\nimport { StyleSheet, css } from 'aphrodite'\nimport createStyleSideEffect from 'react-style-side-effect'\n\nconst HtmlStyle = createStyleSideEffect(document.docElement)\n\nconst styles = StyleSheet.create({\n  html: {\n    fontSize: '14px' // base font size for rem units\n  }\n})\n\nexport default function MyApp() {\n  return (\n    \u003cHtmlStyle className={ css(styles.html) }\u003e\n      ...\n    \u003c/HtmlStyle\u003e\n  )\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjschr%2Freact-style-side-effect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjschr%2Freact-style-side-effect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjschr%2Freact-style-side-effect/lists"}