Skip to content

Commit 88f0298

Browse files
committed
Remove foreground color fix
1 parent 175af75 commit 88f0298

File tree

3 files changed

+26
-19
lines changed

3 files changed

+26
-19
lines changed

Sources/RichTextKit/Colors/Color+SystemSpecificTextColor.swift

Lines changed: 0 additions & 17 deletions
This file was deleted.

Sources/RichTextKit/Styles/RichTextStyle+Toggle.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,12 @@ public extension RichTextStyle {
7171
toggle.toggleStyle(.button)
7272
#endif
7373
}
74-
74+
7575
private var toggle: some View {
7676
SwiftUI.Toggle(isOn: value) {
7777
style.icon
7878
.frame(maxHeight: fillVertically ? .infinity : nil)
7979
}
80-
.foreground(Color(ColorRepresentable.textColor), if: isOn)
8180
.keyboardShortcut(for: style)
8281
.accessibilityLabel(style.title)
8382
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//
2+
// RichTextColorTests.swift
3+
// RichTextKit
4+
//
5+
// Created by Daniel Saidi on 2024-01-23.
6+
// Copyright © 2024 Daniel Saidi. All rights reserved.
7+
//
8+
9+
import RichTextKit
10+
import XCTest
11+
12+
final class RichTextColorTests: XCTestCase {
13+
14+
func testAllCasesExcludesUndefined() {
15+
let colors = RichTextColor.allCases
16+
let expected: [RichTextColor] = [
17+
.foreground,
18+
.background,
19+
.strikethrough,
20+
.stroke,
21+
.underline
22+
]
23+
XCTAssertEqual(colors, expected)
24+
}
25+
}

0 commit comments

Comments
 (0)