iOS: Improve link contrast in dark mode
This commit is contained in:
parent
107c4b0d72
commit
89b226e321
|
@ -14,6 +14,8 @@ struct RenderingBlockView: View {
|
|||
let changeURL: ((URL) -> Void)?
|
||||
@State var hovering = false
|
||||
|
||||
@Environment(\.colorScheme) var colorScheme: ColorScheme
|
||||
|
||||
init(document: Document, block: RenderingBlock, changeURL: ((URL) -> Void)? = nil) {
|
||||
self.document = document
|
||||
self.block = block
|
||||
|
@ -76,7 +78,9 @@ struct RenderingBlockView: View {
|
|||
|
||||
Text(verbatim: text)
|
||||
.font(.documentBody)
|
||||
.foregroundColor(hovering ? .blue : Color.blue.opacity(0.8))
|
||||
.foregroundColor(colorScheme == .dark ?
|
||||
hovering ? Color.blue.opacity(0.8) : .blue :
|
||||
hovering ? .blue : Color.blue.opacity(0.8))
|
||||
.underline()
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue