-
Notifications
You must be signed in to change notification settings - Fork 4k
[feat] Add headingFontSize1-6 and headingFontWeight1-6 CSS Custom Properties #13268
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
[feat] Add headingFontSize1-6 and headingFontWeight1-6 CSS Custom Properties #13268
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
✅ PR preview is ready!
|
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.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
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.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
a799ea8 to
3bef4c9
Compare
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.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
frontend/lib/src/components/widgets/BidiComponent/utils/theme.ts
Outdated
Show resolved
Hide resolved
frontend/lib/src/components/widgets/BidiComponent/utils/theme.ts
Outdated
Show resolved
Hide resolved
SummaryThis PR adds 12 individual heading font properties to the
These new properties provide direct access to specific heading levels (1-6) as an alternative to accessing them through array indices ( Files Changed:
Code QualityExcellent. The implementation is clean, consistent with existing patterns, and follows TypeScript best practices. Positive Aspects:
Code Review: headingFontSize1: string
headingFontSize2: string
headingFontSize3: string
headingFontSize4: string
headingFontSize5: string
headingFontSize6: string
headingFontWeights: number[]
headingFontWeight1: number
headingFontWeight2: number
headingFontWeight3: number
headingFontWeight4: number
headingFontWeight5: numberThe interface additions are well-structured and the types are correct ( headingFontSize1: theme.fontSizes.h1FontSize,
headingFontSize2: theme.fontSizes.h2FontSize,
headingFontSize3: theme.fontSizes.h3FontSize,
headingFontSize4: theme.fontSizes.h4FontSize,
headingFontSize5: theme.fontSizes.h5FontSize,
headingFontSize6: theme.fontSizes.h6FontSize,
// ... weights follow same patternThe extraction logic correctly maps from the EmotionTheme's Test CoverageGood. The tests adequately cover the new functionality and follow best practices. Tests Added:
it.each<
[
key: keyof StreamlitTheme,
value: string | number,
expectedKey: keyof StreamlitThemeCssProperties,
]
>([
["headingFontSize1", "2.75rem", "--st-heading-font-size-1"],
// ... all 12 properties tested
])(
"converts individual heading property %s to CSS custom property",
(propName, value, expectedKey) => {
const overrides: Partial<StreamlitTheme> = { [propName]: value }
const result = objectToCssCustomProperties(createTheme(overrides))
expect(result[expectedKey]).toBe(String(value))
}
)The test follows TypeScript testing best practices by:
Test Coverage Assessment:
Minor Note: There's no explicit test verifying that Backwards CompatibilityFully backward compatible. This is a purely additive change:
Security & RiskNo security concerns or regression risks identified.
RecommendationsNo blocking issues found. The PR is well-implemented and ready for merge. Optional suggestions for future consideration:
VerdictAPPROVED: Clean, well-tested, backward-compatible addition of convenience properties for accessing individual heading font sizes and weights in the Components v2 theme API. This is an automated AI review. Please verify the feedback and use your judgment. |
3bef4c9 to
d892979
Compare
mayagbarnes
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 👍🏼

Describe your changes
Added individual heading font size and weight properties to the StreamlitTheme interface. This enhances the theme by providing direct access to specific heading levels (1-6) rather than only through array indices.
The changes include:
Testing Plan
Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.