Skip to content

Commit 213e70f

Browse files
authored
Merge pull request #1783 from IgniteUI/sivanova/dark-toggle
Fix toggle text visibility in the dark theme
2 parents 3e8a811 + a4f452f commit 213e70f

File tree

8 files changed

+57
-12
lines changed

8 files changed

+57
-12
lines changed

src/app/interactions/toggle/toggle-sample-1/toggle-sample-1.component.scss

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,38 @@
22
width: 150px;
33
margin-bottom: 15px;
44
}
5+
56
.toggle-content{
67
display: flex;
78
width: 320px;
89
height: 260px;
910
}
10-
.toggle-section{
11+
12+
.toggle-section {
1113
flex-flow: row wrap;
1214
display: flex;
1315
width: 100%;
1416
height: 100%;
1517
padding-top: 10px;
16-
background-color: white;
18+
background-color: white ;
1719
font-size: 1.7em;
1820
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
21+
22+
.dark-theme & {
23+
background-color: #111;
24+
}
25+
26+
.custom-body & {
27+
color: var(--igx-surface-500-contrast);
28+
background-color: var(--igx-surface-500);
29+
}
1930
}
20-
ul{
31+
32+
ul {
2133
padding: 20px;
2234
}
23-
li{
35+
36+
li {
2437
margin-bottom: 15px;
2538
list-style-type: none;
26-
}
39+
}

src/app/interactions/toggle/toggle-sample-1/toggle-sample-1.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import { Component, OnInit, ViewChild } from "@angular/core";
1+
import { Component, OnInit, ViewChild, ViewEncapsulation } from "@angular/core";
22
import { IgxToggleDirective } from "igniteui-angular";
33

44
@Component({
5+
encapsulation: ViewEncapsulation.None,
56
selector: "app-toggle-sample-1",
67
styleUrls: ["./toggle-sample-1.component.scss"],
78
templateUrl: "./toggle-sample-1.component.html"

src/app/interactions/toggle/toggle-sample-2/toggle-sample-2.component.scss

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
width: 150px;
33
margin-bottom: 15px;
44
}
5+
56
.toggle-content{
67
display: flex;
78
width: 320px;
89
height: 260px;
910
}
11+
1012
.toggle-section{
1113
flex-flow: row wrap;
1214
display: flex;
@@ -15,9 +17,14 @@
1517
justify-content: center;
1618
align-items: center;
1719
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
20+
21+
.dark-theme & {
22+
background-color: #111;
23+
}
1824
}
25+
1926
img{
2027
width: 300px;
2128
height: 240px;
2229

23-
}
30+
}

src/app/interactions/toggle/toggle-sample-2/toggle-sample-2.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import { Component, OnInit, ViewChild } from "@angular/core";
1+
import { Component, OnInit, ViewChild, ViewEncapsulation } from "@angular/core";
22
import { IgxToggleActionDirective, IgxToggleDirective } from "igniteui-angular";
33

44
@Component({
5+
encapsulation: ViewEncapsulation.None,
56
selector: "app-toggle-sample-2",
67
styleUrls: ["./toggle-sample-2.component.scss"],
78
templateUrl: "./toggle-sample-2.component.html"

src/app/interactions/toggle/toggle-sample-3/toggle-sample-3.component.scss

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
width: 150px;
33
margin-bottom: 15px;
44
}
5+
56
.toggle-content{
67
display: flex;
78
width: 320px;
89
height: 260px;
910
}
11+
1012
.toggle-section{
1113
flex-flow: row wrap;
1214
display: flex;
@@ -16,7 +18,17 @@
1618
align-items: center;
1719
text-align: center;
1820
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
21+
22+
.dark-theme & {
23+
background-color: #111;
24+
}
25+
26+
.custom-body & {
27+
color: var(--igx-surface-500-contrast);
28+
background-color: var(--igx-surface-500);
29+
}
1930
}
31+
2032
h3{
2133
margin: 0;
22-
}
34+
}

src/app/interactions/toggle/toggle-sample-3/toggle-sample-3.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import { Component, OnInit } from "@angular/core";
1+
import { Component, OnInit, ViewEncapsulation } from "@angular/core";
22

33
@Component({
4+
encapsulation: ViewEncapsulation.None,
45
selector: "app-toggle-sample-3",
56
styleUrls: ["./toggle-sample-3.component.scss"],
67
templateUrl: "./toggle-sample-3.component.html"

src/app/interactions/toggle/toggle.component.scss

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,13 @@
1616
background-color: #ffffff;
1717
align-items: center;
1818
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
19-
}
19+
20+
.dark-theme & {
21+
background-color: #111;
22+
}
23+
24+
.custom-body & {
25+
color: var(--igx-surface-500-contrast);
26+
background-color: var(--igx-surface-500);
27+
}
28+
}

src/app/interactions/toggle/toggle.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, ElementRef, ViewChild } from "@angular/core";
1+
import { Component, ElementRef, ViewChild, ViewEncapsulation } from "@angular/core";
22

33
import {
44
CloseScrollStrategy,
@@ -9,6 +9,7 @@ import {
99
} from "igniteui-angular";
1010

1111
@Component({
12+
encapsulation: ViewEncapsulation.None,
1213
selector: "app-toggle",
1314
styleUrls: ["./toggle.component.scss"],
1415
templateUrl: "./toggle.component.html"

0 commit comments

Comments
 (0)