-
Notifications
You must be signed in to change notification settings - Fork 4
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
Dynamic theme switching #170
Conversation
…ture/demo/dynamic-theme-switching
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.
|
||
let bodyFontMetrics = UIFontMetrics(forTextStyle: .body) | ||
let padding = bodyFontMetrics.scaledValue(for: self.spacing.medium) - self.controlBorderWidth | ||
let wideSpacing = bodyFontMetrics.scaledValue(for: self.spacing.xxxLarge) - self.controlBorderWidth |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the wideSpacing here. According to the specs, the spacing is to be xxxLarge
when the label is left aligned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing :)
@@ -230,20 +238,20 @@ public final class CheckboxUIView: UIView { | |||
case .right: | |||
textLabel.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor).isActive = true | |||
textLabel.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor, constant: 0).isActive = true | |||
self.textLabelTrailingConstraint = textLabel.trailingAnchor.constraint(equalTo: controlView.leadingAnchor, constant: -padding) | |||
self.textLabelTrailingConstraint = textLabel.trailingAnchor.constraint(equalTo: controlView.leadingAnchor, constant: -wideSpacing) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a wider spacing, when the label is left aligned.
19ed4ae
to
d64c313
Compare
….com/adevinta/spark-ios into feature/demo/dynamic-theme-switching
…ture/demo/dynamic-theme-switching
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are there accent-colors (in the xcassets file) like accent was a SparkColorToken? 🤔
|
||
let bodyFontMetrics = UIFontMetrics(forTextStyle: .body) | ||
let padding = bodyFontMetrics.scaledValue(for: self.spacing.medium) - self.controlBorderWidth | ||
let wideSpacing = bodyFontMetrics.scaledValue(for: self.spacing.xxxLarge) - self.controlBorderWidth |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch
To switch themes, just shake the device or Simulator: