feat: make progress use lipgloss styles #543
Open
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.
Progress component is not cleanly usable in a lipgloss style driven project, because of its dependencies on termenv colors and color profile. Indeed, Both of them are not directly exposed by lipgloss styles..
Btw, i've managed to make it use lipgloss styles in a backward compatible way \o/
FullStyle
andEmtpyStyle
variables are introduced, having the default foreground color ofFullColor
andEmptyColor
FullColor
andEmptyColor
are deprecated, make their default values to empty string. This way, if they are defined, we can set the foreground during rendering.WithSolidFill
now just apply foreground color toFullStyle
WithFillStyles
option which set bothFullStyle
andEmtpyStyle
. It was inspired byWithFillCharacters
, but can be easily split in bothWithFullStyle
andWithEmtpyStyle
if you preferWithColorProfile
is the most touchy part :) It recreates and make them inherit from themselvesFullStyle
andEmtpyStyle
, but starting from the default renderer, and applies color profile to itThe rest is all about using
FullStyle
andEmtpyStyle
to render runes, instead of termenv.String.Happy comments :)