Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
<h1>Angular Bootstrap theme switcher example</h1>
<app-theme-switcher></app-theme-switcher>
<hr class="mb-4">
<h2>This component uses theme-defined colors:</h2>
<app-component-with-custom-color></app-component-with-custom-color>
<hr class="mb-4">
<footer>
<p class="mb-4">
<a href="https://github.com/jfhr/ngb-theme-switcher-example" referrerpolicy="no-referrer">Source code</a>
Expand Down
4 changes: 3 additions & 1 deletion src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import { ThemeService } from './theme.service';
import { ThemeSwitcherComponent } from './theme-switcher/theme-switcher.component';
import { ComponentWithCustomColorComponent } from './component-with-custom-color/component-with-custom-color.component';

@NgModule({
declarations: [
AppComponent,
ThemeSwitcherComponent
ThemeSwitcherComponent,
ComponentWithCustomColorComponent
],
imports: [
BrowserModule
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<div class="border-warning p-2"><span>border in warning color</span></div>

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@import "node_modules/bootstrap/scss/functions"

.border-warning
border: 1px solid var(--bs-warning)
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { ComponentWithCustomColorComponent } from './component-with-custom-color.component';

describe('ComponentWithCustomColorComponent', () => {
let component: ComponentWithCustomColorComponent;
let fixture: ComponentFixture<ComponentWithCustomColorComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ ComponentWithCustomColorComponent ]
})
.compileComponents();
});

beforeEach(() => {
fixture = TestBed.createComponent(ComponentWithCustomColorComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';

@Component({
selector: 'app-component-with-custom-color',
templateUrl: './component-with-custom-color.component.html',
styleUrls: ['./component-with-custom-color.component.sass']
})
export class ComponentWithCustomColorComponent implements OnInit {

constructor() { }

ngOnInit(): void {
}

}