Last change
on this file since ceaed42 was fa375fe, checked in by Ema <ema_spirova@…>, 3 years ago |
adding new components
|
-
Property mode
set to
100644
|
File size:
1.1 KB
|
Rev | Line | |
---|
[fa375fe] | 1 | // stylelint-disable media-feature-name-no-vendor-prefix, media-feature-parentheses-space-inside, media-feature-name-no-unknown, indentation, at-rule-name-space-after
|
---|
| 2 |
|
---|
| 3 | // Responsive image
|
---|
| 4 | //
|
---|
| 5 | // Keep images from scaling beyond the width of their parents.
|
---|
| 6 | .img-responsive(@display: block) {
|
---|
| 7 | display: @display;
|
---|
| 8 | max-width: 100%; // Part 1: Set a maximum relative to the parent
|
---|
| 9 | height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching
|
---|
| 10 | }
|
---|
| 11 |
|
---|
| 12 |
|
---|
| 13 | // Retina image
|
---|
| 14 | //
|
---|
| 15 | // Short retina mixin for setting background-image and -size. Note that the
|
---|
| 16 | // spelling of `min--moz-device-pixel-ratio` is intentional.
|
---|
| 17 | .img-retina(@file-1x; @file-2x; @width-1x; @height-1x) {
|
---|
| 18 | background-image: url("@{file-1x}");
|
---|
| 19 |
|
---|
| 20 | @media
|
---|
| 21 | only screen and (-webkit-min-device-pixel-ratio: 2),
|
---|
| 22 | only screen and ( min--moz-device-pixel-ratio: 2),
|
---|
| 23 | only screen and ( -o-min-device-pixel-ratio: 2/1),
|
---|
| 24 | only screen and ( min-device-pixel-ratio: 2),
|
---|
| 25 | only screen and ( min-resolution: 192dpi),
|
---|
| 26 | only screen and ( min-resolution: 2dppx) {
|
---|
| 27 | background-image: url("@{file-2x}");
|
---|
| 28 | background-size: @width-1x @height-1x;
|
---|
| 29 | }
|
---|
| 30 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.