mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Adopt Compound Colours (#1086)
* Delete deprecated font tokens. * Migrate from primaryContent to textPrimary/iconPrimary. * Migrate from links to textLinkExternal. * Migrate from secondaryContent to textSecondary/iconSecondary. * Migrate from accent to textActionPrimary. - Some uses changed to textPrimary or iconPrimary as necessary. - Some manual tints removed now that that Sentry is fixed. * Migrate alert to textCriticalPrimary/iconCriticalPrimary. * Migrate from brand to textActionAccent/iconAccentTertiary. * Migrate from background to bgCanvasDefault or text/iconOnSolidPrimary * Migrate system to bgSubtleSecondary. * Remove ElementUIColors and obsolete migrated colours. * Migrate tertiaryContent/quaternaryContent/quinaryContent to Compound. * Migrate bubblesYou/bubblesNotYou to use Compound. * Update Compound.
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import Compound
|
||||
import DesignTokens
|
||||
import SwiftUI
|
||||
|
||||
@@ -22,7 +23,7 @@ public extension ButtonStyle where Self == ElementGhostButtonStyle {
|
||||
/// - Parameter size: The control size to use. Defaults to `regular`.
|
||||
/// - Parameter color: The color of the label and border. Defaults to the accent color.
|
||||
static func elementGhost(_ size: ElementControlSize = .regular,
|
||||
color: Color = .element.primaryContent) -> ElementGhostButtonStyle {
|
||||
color: Color = .compound.textActionAccent) -> ElementGhostButtonStyle {
|
||||
ElementGhostButtonStyle(size: size, color: color)
|
||||
}
|
||||
}
|
||||
@@ -36,7 +37,7 @@ public struct ElementGhostButtonStyle: ButtonStyle {
|
||||
private var verticalPadding: CGFloat { size == .xLarge ? 12 : 4 }
|
||||
private var maxWidth: CGFloat? { size == .xLarge ? .infinity : nil }
|
||||
|
||||
public init(size: ElementControlSize = .regular, color: Color = .element.primaryContent) {
|
||||
public init(size: ElementControlSize = .regular, color: Color = .compound.textActionAccent) {
|
||||
self.size = size
|
||||
self.color = color
|
||||
}
|
||||
@@ -75,13 +76,13 @@ public struct ElementGhostButtonStyle_Previews: PreviewProvider {
|
||||
.disabled(true)
|
||||
|
||||
Button("Red BG") { /* preview */ }
|
||||
.buttonStyle(ElementGhostButtonStyle(color: .element.alert))
|
||||
.buttonStyle(ElementGhostButtonStyle(color: .compound.textCriticalPrimary))
|
||||
|
||||
Button { /* preview */ } label: {
|
||||
Text("Custom")
|
||||
.foregroundColor(.element.primaryContent)
|
||||
.foregroundColor(.compound.iconInfoPrimary)
|
||||
}
|
||||
.buttonStyle(ElementGhostButtonStyle(color: .element.quaternaryContent))
|
||||
.buttonStyle(ElementGhostButtonStyle(color: .compound.borderInfoSubtle))
|
||||
}
|
||||
.padding()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user