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

Max-size for images on mobile views #20

Open
wilzbach opened this issue Aug 4, 2016 · 8 comments
Open

Max-size for images on mobile views #20

wilzbach opened this issue Aug 4, 2016 · 8 comments

Comments

@wilzbach
Copy link
Member

wilzbach commented Aug 4, 2016

As you can see below images look a bit pixelated and too large on mobile devices.
I guess something like max-height: 30% could be an easy solution.
Anyways great article!

screenshot_20160804-165653

@mdparker
Copy link
Member

After I saw this I shrunk the size of the image a bit. I'll see about adding a more generic solution at some point. I really wish my CSS fu were stronger.

@wilzbach
Copy link
Member Author

I'll see about adding a more generic solution at some point. I really wish my CSS fu were stronger.

Maybe there's a solution for WordPress (my WordPress fu isn't existing), but there's the picture tag which allows to give the browser multiple sources and it picks the best one depending on his resolution. It works in all major browsers (yes IE doesn't count as major browser for me anymore), but in case you are worried there's a polyfill too.

@wilzbach
Copy link
Member Author

wilzbach commented Mar 5, 2017

but there's the picture tag which allows to give the browser multiple sources and it picks the best one depending on his resolution

And as mentioned sth. like

article img .alignleft {
   max-height: 30%;
}

should do the trick ;-)

@wilzbach
Copy link
Member Author

wilzbach commented Feb 7, 2018

Ping at this - it's still happening on every blog article, e.g.

image

It's really as simple as adding the three lines of CSS I proposed, I just wasn't sure to which file I should make a PR too. style.css?

@mdparker
Copy link
Member

mdparker commented Feb 7, 2018

The thing to do is to add it to style_nomin.css, then run it through a minimizer and save it as style.css. The problem is that there's so many options in there it's hard (for me at least) figure out exactly where to put new stuff. Every time I've added something where I thought it belonged, it had no effect and I had to dig around. And then there are the difference sections for the different screen sizes... ugh. I really want something less complex to maintain.

Anyway, if you can figure it out, I'm happy to take a pull request. If not, I'll make this a priority and work on it tomorrow. I need to set WP up locally again so I can test it out.

@mdparker
Copy link
Member

mdparker commented Feb 8, 2018

I can't get the max-height/width attributes to do anything. When I shrink the window down, the image eventually pops up above the text, but I have yet to see where the hell I need to add the img attributes to make it happen sooner. I friggin complex CSS files.

@wilzbach
Copy link
Member Author

wilzbach commented Feb 8, 2018

Okay, I will give it a try later today - sorry I have been busy 😕

@wilzbach
Copy link
Member Author

wilzbach commented Feb 8, 2018

Here's what I came up with:

#25

I friggin complex CSS files.
...
Every time I've added something where I thought it belonged,

My approach was rather pragmatic - add it to the bottom. That worked well for dlang.org so far too.

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

No branches or pull requests

2 participants