Skip to content
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

feature: min #175

Merged
merged 1 commit into from Feb 27, 2015
Merged

feature: min #175

merged 1 commit into from Feb 27, 2015

Conversation

LinusU
Copy link
Contributor

@LinusU LinusU commented Feb 27, 2015

fixes #174

This add a new feature .min() which preserves the aspect ration and resize the image to the minimum width or height specified.

On another note, we might want to make the documentation for max() and min() a bit clearer. This is how Mozilla describes the background-size values contain and cover:

cover
This keyword specifies that the background image should be scaled to be as small as possible while ensuring both its dimensions are greater than or equal to the corresponding dimensions of the background positioning area.

contain
This keyword specifies that the background image should be scaled to be as large as possible while ensuring both its dimensions are less than or equal to the corresponding dimensions of the background positioning area.

I think that if we draw some inspiration from here we can make it a bit more clear what they do. @lovell?

@LinusU LinusU mentioned this pull request Feb 27, 2015
@LinusU
Copy link
Contributor Author

LinusU commented Feb 27, 2015

The Snap CI build fails because of c7ccf68, I don't think that I can be blamed for that :)

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 97.51% when pulling bcd82f4 on LinusU:feature-min into 749dc61 on lovell:master.

@lovell
Copy link
Owner

lovell commented Feb 27, 2015

This is a perfect patch, favour fortunes the brave, thank you!

Good call on simplifying the docs - leave it with me.

Snap CI is failing as it only provides gcc 4.4 by default and therefore isn't fully C++11 compatible. I've updated the environment to manually install gcc 4.7 each time but it doesn't seem to apply to Pull Requests.

lovell added a commit that referenced this pull request Feb 27, 2015
@lovell lovell merged commit 88753a6 into lovell:master Feb 27, 2015
@LinusU LinusU deleted the feature-min branch February 27, 2015 13:37
@LinusU
Copy link
Contributor Author

LinusU commented Feb 27, 2015

Thanks for quick pull! 🍻

Would appreciate it if you could publish this as 0.9.4 to npm :)

@lovell
Copy link
Owner

lovell commented Feb 27, 2015

v0.9.3 will be published within the next hour - currently fixing CI environment problems.

@LinusU
Copy link
Contributor Author

LinusU commented Feb 27, 2015

Understandable, thanks! I appreciate it

@lovell
Copy link
Owner

lovell commented Feb 27, 2015

All done, enjoy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: .min()
3 participants