Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Design System] Update color values to match Figma #22402

Merged
merged 2 commits into from
Feb 5, 2024
Merged
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
2 changes: 1 addition & 1 deletion Modules/Sources/DesignSystem/Components/DSButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public struct DSButton: View {
.fill(style.backgroundColor.opacity(priamryDisabledOpacity))
case .secondary:
RoundedRectangle(cornerRadius: Length.Radius.small)
.stroke(Color.DS.divider, lineWidth: 1)
.stroke(Color.DS.Background.tertiary, lineWidth: 1)
.background(Color.clear)

case .tertiary:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ public extension Color {
private static let wordPress = colorWithModuleBundle(colorName: DesignSystemColorNames.Background.wordPress)
}

public static let divider = colorWithModuleBundle(colorName: DesignSystemColorNames.divider)
Copy link
Contributor

@salimbraksa salimbraksa Feb 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: it would be great to keep this property for convenience, similar to UIColor.separator.

public static var divider: Color {
   return Background.tertiary
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. Do you mean to keep this but use the background tertiary as its value? I am not sure about it. Reason being is that on Figma design will mention Background.tertiary and most likely the developer will use that value. If we use another naming even for convenience, that could break the sync between platforms. After all the whole point is that the names on Android, iOS and Figma to fully match. Wdyt?


private static func colorWithModuleBundle(colorName: String) -> Color {
Color(colorName, bundle: .module)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x79",
"green" : "0x78",
"red" : "0x78"
"blue" : "0x4F",
"green" : "0x4E",
"red" : "0x4E"
}
},
"idiom" : "universal"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x2E",
"green" : "0x2C",
"red" : "0x2C"
"blue" : "0x3C",
"green" : "0x3A",
"red" : "0x3A"
}
},
"idiom" : "universal"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
"colors" : [
{
"color" : {
"color-space" : "extended-gray",
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"white" : "0xC2"
"blue" : "198",
"green" : "194",
"red" : "194"
}
},
"idiom" : "universal"
Expand All @@ -21,9 +23,9 @@
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x3C",
"green" : "0x3A",
"red" : "0x3A"
"blue" : "0x2E",
"green" : "0x2C",
"red" : "0x2C"
}
},
"idiom" : "universal"
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ public extension UIColor {
private static let wordPress = colorWithModuleBundle(colorName: DesignSystemColorNames.Background.wordPress)
}

public static let divider = colorWithModuleBundle(colorName: DesignSystemColorNames.divider)

private static func colorWithModuleBundle(colorName: String) -> UIColor? {
UIColor(named: colorName, in: .module, compatibleWith: .current)
}
Expand Down
11 changes: 0 additions & 11 deletions Modules/Sources/DesignSystem/Gallery/ColorGallery.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ struct ColorGallery: View {
Group {
foregroundSection
backgroundSection
dividerSection
}
}
.navigationTitle("Colors")
Expand Down Expand Up @@ -89,16 +88,6 @@ struct ColorGallery: View {
}
}

private var dividerSection: some View {
Section(header: sectionTitle("Divider")) {
listItem(
with: "Divider",
hexString: hexString(for: .DS.divider),
color: Color.DS.divider
)
}
}

private func hexString(for color: UIColor?) -> String? {
colorScheme == .light ? color?.lightVariant().hexString() : color?.darkVariant().hexString()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ struct CompliancePopover: View {
}) {
ZStack {
RoundedRectangle(cornerRadius: Length.Padding.single)
.stroke(Color.DS.divider, lineWidth: Length.Border.thin)
.stroke(Color.DS.Background.tertiary, lineWidth: Length.Border.thin)
Text(Strings.settingsButtonTitle)
.font(.body)
}
Expand Down