{"id":15180511,"url":"https://github.com/clashsoft/ng-bootstrap-darkmode","last_synced_at":"2025-10-01T21:31:08.469Z","repository":{"id":47186668,"uuid":"293075669","full_name":"Clashsoft/ng-bootstrap-darkmode","owner":"Clashsoft","description":"An Angular wrapper for bootstrap-darkmode.","archived":true,"fork":false,"pushed_at":"2023-04-14T13:40:46.000Z","size":638,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-16T17:51:40.665Z","etag":null,"topics":["angular","bootstrap","bootstrap-theme","dark-mode","dark-theme"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Clashsoft.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-09-05T12:54:53.000Z","updated_at":"2023-04-14T13:41:10.000Z","dependencies_parsed_at":"2022-09-11T04:51:54.739Z","dependency_job_id":null,"html_url":"https://github.com/Clashsoft/ng-bootstrap-darkmode","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Clashsoft%2Fng-bootstrap-darkmode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Clashsoft%2Fng-bootstrap-darkmode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Clashsoft%2Fng-bootstrap-darkmode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Clashsoft%2Fng-bootstrap-darkmode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Clashsoft","download_url":"https://codeload.github.com/Clashsoft/ng-bootstrap-darkmode/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234902725,"owners_count":18904521,"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":["angular","bootstrap","bootstrap-theme","dark-mode","dark-theme"],"created_at":"2024-09-27T16:21:37.379Z","updated_at":"2025-10-01T21:31:03.162Z","avatar_url":"https://github.com/Clashsoft.png","language":"TypeScript","readme":"# NgBootstrapDarkmode - moved to [ngbx](https://github.com/Clashsoft/meanstream/tree/master/libs/ngbx#readme)\n\n[![npm version](https://badge.fury.io/js/ng-bootstrap-darkmode.svg)](https://badge.fury.io/js/ng-bootstrap-darkmode)\n[![Node.js CI](https://github.com/Clashsoft/ng-bootstrap-darkmode/workflows/Node.js%20CI/badge.svg)](https://github.com/Clashsoft/ng-bootstrap-darkmode/actions?query=workflow%3A%22Node.js+CI%22)\n\nAn Angular wrapper for [bootstrap-darkmode](https://github.com/Clashsoft/bootstrap-darkmode).\n\n## Installation\n\nInstall the module:\n\n```sh\n$ npm install ng-bootstrap-darkmode bootstrap-darkmode\n```\n\nInclude darkmode css (in `styles.scss`):\n\n```scss\n@import \"~bootstrap-darkmode/scss/darktheme\";\n```\n\nAlternatively, if you are not using SCSS, add the following in `angular.json` under `projects.\u003cyourProject\u003e.architect.build.options.styles`:\n\n```json5\n\"styles\": [\n  // ...\n  \"../node_modules/bootstrap-darkmode/dist/darktheme.css\"\n]\n```\n\n## Usage\n\n### Module Import\n\n```typescript\nimport {NgBootstrapDarkmodeModule} from 'ng-bootstrap-darkmode';\n\n@NgModule({\n  imports: [\n    // ...\n    NgBootstrapDarkmodeModule,\n  ],\n  // ...\n})\nexport class AppModule {\n}\n```\n\n### Theme Switcher\n\nTo include the theme switcher, which allows selections between light, dark and automatic (user agent preference) mode:\n\n```html\n\u003cngbd-theme-switch\u003e\u003c/ngbd-theme-switch\u003e\n```\n\nThe theme switcher can be customized with the optional `[size]` and `[style]` attributes:\n\n```html\n\u003cngbd-theme-switch size=\"sm\"\u003e\u003c/ngbd-theme-switch\u003e\n\u003cngbd-theme-switch size=\"md\"\u003e\u003c/ngbd-theme-switch\u003e\n\u003cngbd-theme-switch size=\"lg\"\u003e\u003c/ngbd-theme-switch\u003e\n\u003cngbd-theme-switch [size]=\"userPrefersLargeElements ? 'lg' : 'md'\"\u003e\u003c/ngbd-theme-switch\u003e\n\n\u003cngbd-theme-switch style=\"icon\"\u003e\u003c/ngbd-theme-switch\u003e\n\u003cngbd-theme-switch style=\"label\"\u003e\u003c/ngbd-theme-switch\u003e\n\u003cngbd-theme-switch [style]=\"userPrefersLabelsOverIcons ? 'label' : 'icon'\"\u003e\u003c/ngbd-theme-switch\u003e\n```\n\nAn outdated alternative is the dark mode switch, which does not support automatic mode:\n\n```html\n\u003cngbd-darkmode-switch\u003e\u003c/ngbd-darkmode-switch\u003e\n```\n\n### Subscribing to the Theme\n\n```typescript\nimport {ThemeService} from 'ng-bootstrap-darkmode';\n\n@Injectable()\nexport class MyService {\n  constructor(\n    themeService: ThemeService,\n  ) {\n    themeService.theme$.subscribe(theme =\u003e console.log(theme));\n  }\n}\n```\n\n### Configuring Persistence\n\nBy default, this library persists the currently selected theme using the key `theme` in `localStorage`.\nYou can customize how this behaviour using dependency injection.\nJust provide the `THEME_SAVER` and `THEME_LOADER` functions in your module:\n\n```typescript\nimport {of} from 'rxjs';\n\nimport {NgBootstrapDarkmodeModule, THEME_LOADER, THEME_SAVER} from 'ng-bootstrap-darkmode';\n\n@NgModule({\n  imports: [\n    // ...\n    NgBootstrapDarkmodeModule,\n  ],\n  providers: [\n    {\n      provide: THEME_LOADER,\n      useValue: () =\u003e of('light'),\n    },\n    {\n      provide: THEME_SAVER,\n      useValue: (theme) =\u003e console.log('saving', theme),\n    },\n  ],\n  // ...\n})\nexport class AppModule {\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclashsoft%2Fng-bootstrap-darkmode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclashsoft%2Fng-bootstrap-darkmode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclashsoft%2Fng-bootstrap-darkmode/lists"}