style(kol-progress): replace inline style width with SVG width attribute in BarSvg #8006#8009
Merged
deleonio merged 1 commit intopublic-ui:developfrom Jul 14, 2025
donchi-donald:8006-inline-styles-progress-css
Merged
style(kol-progress): replace inline style width with SVG width attribute in BarSvg #8006#8009deleonio merged 1 commit intopublic-ui:developfrom donchi-donald:8006-inline-styles-progress-css
width with SVG width attribute in BarSvg #8006#8009deleonio merged 1 commit intopublic-ui:developfrom
donchi-donald:8006-inline-styles-progress-css
Conversation
…tribute in BarSvg #8006
deleonio
approved these changes
Jul 14, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Änderungen im Überblick
In der Komponente BarSvg haben wir das statische Inline-Style-Attribut
- style={{ width: '100%' }}durch das native SVG-Attribut
+ width="100%"ersetzt.
Alle anderen, auf Prozent- oder Pixel-Berechnungen basierenden Style-Anweisungen (z. B.
) wurden bewusst nicht angefasst, da sie dynamisch vom Component-State abhängen.
Begründung der Änderungen
SVG-Presentation-Attributes wie
width="100%"sind im Rendering konsistenter unterstützt als CSS-Inline-Styles auf<rect>-Elementen.Statische Größen gehören ins Markup (SVG-Attribute), komplexe, vom State abhängige Werte in die Component-Logik.
Presentation Attributes lassen sich leichter durch externe CSS-Fallbacks oder Themes adaptieren, während Inline-Styles eine sehr hohe Spezifität besitzen und Overrides erschweren.
Warum der dynamische Style unverändert bleibt
Die Breite der Fortschrittsanzeige (
calc(${percentage}% – 4px)) hängt direkt vom aktuellen Progress-State ab. Dieser Wert wird zur Laufzeit berechnet und muss deshalb als Inline-Style in JSX verbleiben, um die Übergänge korrekt zu visualisieren und Performance-Einbußen durch ständige CSS-Regel-Generierung zu vermeiden.