-
Notifications
You must be signed in to change notification settings - Fork 840
[web] Update shell styles #260
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
Conversation
dfa925f to
70311f1
Compare
ava-cassiopeia
left a comment
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.
LGTM, just a few small comments; feel free to follow up on them in a different PR.
renderers/lit/src/0.8/ui/text.ts
Outdated
| let additionalStyles: Record<string, string> = {}; | ||
| const styles = this.theme.additionalStyles?.Text; | ||
| if (styles) { | ||
| if ("h1" in styles) { | ||
| const hint = this.usageHint ?? "body"; | ||
| additionalStyles = styles[hint] as Record<string, string>; | ||
| } else { | ||
| additionalStyles = styles; | ||
| } | ||
| } |
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.
NIT: this logic smells to me like it would be better served as its own private method for readability, as you could improve the readability by using guard clauses instead of nested conditionals; something like:
#getAdditionalStyles(...): Record<string, string> {
const styles = this.theme.additionalStyles?.Text;
if (!styles) return {};
// etc.
}Feel free to do this in a followup PR if you want.
renderers/lit/src/0.8/ui/surface.ts
Outdated
| 100 - i | ||
| }%, #fff ${i}%)`; | ||
| } | ||
| // Ignored for now. |
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.
NIT: Is it worth clarifying why this is being ignored? Here and below.
This brings the styling in line with the pre-existing theme machinery. This applies to both the restaurant and contacts examples for both light & dark themes.