We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi, I often set images as backgrounds, especially when I need specific ratio, maybe mixin for that can look something like this
.thumb-image { @util bg-image(/assets/images/awesome-image.jpg); }
.thumb-image { background-image: url(/assets/images/awesome-image.jpg); background-position: center; background-size: cover; }
Or maybe in combination with aspect-ratio mixin
.thumb-image { @util aspect-ratio(16:9); @util bg-image(/assets/images/awesome-image.jpg); }
The text was updated successfully, but these errors were encountered:
Hi @markoarsenal! It's good idea, but I think that maybe bg-image is not the best name because it could be confused with background-image property.
bg-image
background-image
I suggest something like this: @util cover('assets/images/awesome-image.jpg');
@util cover('assets/images/awesome-image.jpg');
Sorry, something went wrong.
You're right about name :) But, I imagined that mixin can also accept other params, for example:
.thumb-image { @util bg('assets/images/awesome-image.jpg', top, contain); }
.thumb-image { background-image: url(/assets/images/awesome-image.jpg); background-position: top; background-size: contain; }
Maybe also to consider other params for background, those three I use the most.
No branches or pull requests
Hi, I often set images as backgrounds, especially when I need specific ratio, maybe mixin for that can look something like this
Or maybe in combination with aspect-ratio mixin
The text was updated successfully, but these errors were encountered: