Skip to content

Commit

Permalink
fix(style): add .no-enlarge to exclude specific images
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Now you can add `.no-enlarge` to images that you'd like to keep it in normal width in smaller devices:

```html
<img class="no-enlarge" src="/ipad-frame-01.png">
```
  • Loading branch information
sparanoid committed Aug 26, 2015
1 parent 486372e commit 9a78b77
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions _app/assets/themes/curtana/_less/app.less
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,9 @@ body:hover .latest {
// Override margin from article img
svg,
img {
// avoid images inside .browser stretched by global img styles
margin: 0;
// avoid header stretched by global img styles
margin-left: 0;
margin-right: 0;
margin-bottom: .3em;

@media (max-width: @breakpoint-sm) {
Expand Down Expand Up @@ -400,6 +401,7 @@ body:hover .latest {
max-width: 100%;
margin: 0 0 1.8rem;


@media (max-width: @breakpoint-md) {
margin-left: -@padding-md;
margin-right: -@padding-md;
Expand All @@ -413,6 +415,14 @@ body:hover .latest {
max-width: calc(100% + (@padding-sm * 2));
width: calc(100% + (@padding-sm * 2));
}

// avoid images with `.no-enlarge` stretched by global img styles
&.no-enlarge {
margin-left: 0;
margin-right: 0;
max-width: 100%;
width: auto;
}
}

blockquote {
Expand Down Expand Up @@ -619,7 +629,8 @@ body:hover .latest {

img {
// avoid images inside .browser stretched by global img styles
margin: 0;
margin-left: 0;
margin-right: 0;
box-shadow: 0 -1px 0 0 rgba(0, 0, 0, .05);

// Reset borwser image width for small screens
Expand Down

0 comments on commit 9a78b77

Please sign in to comment.