fix: add contain mode with fixed cover height option#13
Open
lotadevstudio wants to merge 5 commits intosleroq:mainfrom
Open
fix: add contain mode with fixed cover height option#13lotadevstudio wants to merge 5 commits intosleroq:mainfrom
lotadevstudio wants to merge 5 commits intosleroq:mainfrom
Conversation
Adds contain-fixed as a third image fit option alongside the existing cover and contain modes. Users can now use image contain without losing manual height control. Fixes sleroq#7
Adds contain-fixed as a third image fit option alongside the existing cover and contain modes. Users can now use image contain without losing manual height control. Fixes sleroq#7
sleroq
reviewed
Mar 22, 2026
- Change image fit options from array to map for correct Obsidian types - Revert styles.css formatting changes, keep only new CSS classes
sleroq
reviewed
Mar 23, 2026
Comment on lines
+1864
to
1869
| private getCardCoverFitFromConfig(): "cover" | "contain" | "contain-fixed" { | ||
| const fit = this.config?.get(CARD_COVER_FIT_OPTION_KEY); | ||
| if (fit === "contain") return "contain"; | ||
| if (fit === "contain-fixed") return "contain-fixed"; | ||
| return "cover"; | ||
| } |
Owner
There was a problem hiding this comment.
This will handle backward compatibility for the old option
Suggested change
| private getCardCoverFitFromConfig(): "cover" | "contain" | "contain-fixed" { | |
| const fit = this.config?.get(CARD_COVER_FIT_OPTION_KEY); | |
| if (fit === "contain") return "contain"; | |
| if (fit === "contain-fixed") return "contain-fixed"; | |
| return "cover"; | |
| } | |
| private getCardCoverFitFromConfig(): "cover" | "contain" | "contain-fixed" { | |
| const fit = this.config?.get(CARD_COVER_FIT_OPTION_KEY); | |
| if (fit === "cover" || fit === "contain" || fit === "contain-fixed") { | |
| return fit; | |
| } | |
| // Backward compatibility for removed option | |
| if (this.config?.get("cardCoverContain") === true) { | |
| return "contain"; | |
| } | |
| return "cover"; | |
| } |
Author
There was a problem hiding this comment.
Done, applied your suggestion.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds contain-fixed as a third image fit option alongside the existing cover and contain modes. Users can now use image contain without losing manual height control.
Fixes #7