{"id":13798754,"url":"https://github.com/firebaseextended/remote-styles","last_synced_at":"2025-05-13T06:31:35.196Z","repository":{"id":35270355,"uuid":"216875276","full_name":"FirebaseExtended/remote-styles","owner":"FirebaseExtended","description":"Conditionally load CSS from Firebase Remote Config","archived":true,"fork":false,"pushed_at":"2023-01-05T23:35:30.000Z","size":1468,"stargazers_count":64,"open_issues_count":44,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-08T03:04:38.893Z","etag":null,"topics":["css","firebase","firebase-remote-config"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FirebaseExtended.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-22T17:47:11.000Z","updated_at":"2024-02-06T18:31:15.000Z","dependencies_parsed_at":"2023-01-15T17:23:01.388Z","dependency_job_id":null,"html_url":"https://github.com/FirebaseExtended/remote-styles","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/FirebaseExtended%2Fremote-styles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FirebaseExtended%2Fremote-styles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FirebaseExtended%2Fremote-styles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FirebaseExtended%2Fremote-styles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FirebaseExtended","download_url":"https://codeload.github.com/FirebaseExtended/remote-styles/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253888870,"owners_count":21979520,"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","firebase","firebase-remote-config"],"created_at":"2024-08-04T00:00:52.258Z","updated_at":"2025-05-13T06:31:34.863Z","avatar_url":"https://github.com/FirebaseExtended.png","language":"TypeScript","funding_links":[],"categories":["웹"],"sub_categories":[],"readme":"# remote-styles\n\n\u003e Conditionally load CSS from Firebase Remote Config\n\n### Status: Alpha\n\n## Install\n```bash\nnpm i remote-styles firebase\n# OR\nyarn add remote-styles firebase\n```\n\n## Basic Example\n\nWebpack/Module Bundler usage\n\n```ts\nimport { initialize } from 'remote-styles';\n\nasync function importStyles() {\n  // Be smart and lazy load. Dynamic styles\n  // are not likely needed for page load.\n  const firebase = await import('firebase/app');\n  await import('firebase/analytics');\n  await import('firebase/remote-config');\n\n  const firebaseApp = firebase.initializeApp({ \n    /* config */ \n  });\n  const getStyles = await initialize(firebaseApp);\n  const styles = getStyles('dark_mode');\n  styles.insert();\n}\n\nimportStyles();\n```\n\n## Script Tags / Loader Version\n\n`remote-styles` has a sub-package that lazy loads Firebase. This is useful for sites that use script tags instad of module bundling.\n\n\n```html\n\u003cbody\u003e\n  \u003cdiv class=\"text-main config-dark\"\u003eThis can be configured remotely!\u003c/div\u003e\n  \u003cscript src=\"https://unpkg.com/remote-styles/dist/remote-styles-loader.min.js\"\u003e\u003c/script\u003e\n  \u003cscript\u003e\n      (async function(window, remoteStyles) {\n        const getStyles = await remoteStyles.initialize({\n          /* config */\n        });\n        const styles = getStyles('dark_mode');\n        styles.insert();\n      }(window, window.remoteStyles));\n  \u003c/script\u003e\n\u003c/body\u003e\n```\n\n## Upload/Download CSS from Remote Config via the CLI\n\nTo use the CLI you'll need to download a Service Account from the Firebase Console.\n\n### Downloading CSS\n\nDownloading CSS currently works only with default parameters.\n\n```bash\nnode_modules/.bin/remote-styles get --key=\"CSS\" --sa=\"./sa.json\" --out=\"styles.css\"\n```\n\n### Uploading CSS\n\nUploading CSS currently works only with default parameters.\n\n```bash\nnode_modules/.bin/remote-styles put --key=\"CSS\" --sa=\"./sa.json\" styles.css\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirebaseextended%2Fremote-styles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffirebaseextended%2Fremote-styles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirebaseextended%2Fremote-styles/lists"}