Stop making previews for light & dark colour schemes. (#345)

Xcode 14 now has preview variants for this.
This commit is contained in:
Doug
2022-11-25 17:49:13 +00:00
committed by GitHub
parent 00cd2ab707
commit f776575c81
32 changed files with 29 additions and 207 deletions
@@ -67,7 +67,7 @@ public struct ElementActionButtonStyle: ButtonStyle {
}
public struct ElementActionButtonStyle_Previews: PreviewProvider {
public static var states: some View {
public static var previews: some View {
VStack {
Button("Enabled") { /* preview */ }
.buttonStyle(ElementActionButtonStyle())
@@ -87,11 +87,4 @@ public struct ElementActionButtonStyle_Previews: PreviewProvider {
}
.padding()
}
public static var previews: some View {
states
.preferredColorScheme(.light)
states
.preferredColorScheme(.dark)
}
}
@@ -59,7 +59,7 @@ public struct ElementCapsuleButtonStyle: ButtonStyle {
}
struct ElementCapsuleButtonStyle_Previews: PreviewProvider {
public static var states: some View {
public static var previews: some View {
VStack {
Button("Enabled") { /* preview */ }
.buttonStyle(.elementCapsuleProminent)
@@ -77,11 +77,4 @@ struct ElementCapsuleButtonStyle_Previews: PreviewProvider {
}
.padding()
}
public static var previews: some View {
states
.preferredColorScheme(.light)
states
.preferredColorScheme(.dark)
}
}
@@ -66,17 +66,6 @@ public struct ElementGhostButtonStyle: ButtonStyle {
public struct ElementGhostButtonStyle_Previews: PreviewProvider {
public static var previews: some View {
Group {
states
}
.preferredColorScheme(.light)
Group {
states
}
.preferredColorScheme(.dark)
}
public static var states: some View {
VStack {
Button("Enabled") { /* preview */ }
.buttonStyle(ElementGhostButtonStyle())
@@ -97,7 +97,7 @@ public struct BorderedInputFieldStyle: TextFieldStyle {
}
public struct BorderedInputFieldStyle_Previews: PreviewProvider {
public static var states: some View {
public static var previews: some View {
VStack {
TextField("Placeholder", text: .constant(""))
.textFieldStyle(BorderedInputFieldStyle())
@@ -115,13 +115,4 @@ public struct BorderedInputFieldStyle_Previews: PreviewProvider {
}
.padding()
}
public static var previews: some View {
Group {
states
.preferredColorScheme(.light)
states
.preferredColorScheme(.dark)
}
}
}
@@ -74,7 +74,7 @@ public struct ElementTextFieldStyle: TextFieldStyle {
@available(iOS 15.0, *)
struct ElementTextFieldStyle_Previews: PreviewProvider {
public static var states: some View {
public static var previews: some View {
VStack(spacing: 12) {
TextField("Placeholder", text: .constant(""))
.textFieldStyle(.elementInput(labelText: "Label", footerText: "Footer"))
@@ -88,13 +88,4 @@ struct ElementTextFieldStyle_Previews: PreviewProvider {
}
.padding()
}
public static var previews: some View {
Group {
states
.preferredColorScheme(.light)
states
.preferredColorScheme(.dark)
}
}
}