-
Notifications
You must be signed in to change notification settings - Fork 422
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
Need fix for Large-format type size when container isn't 100% width #133
Comments
If only there was a |
OK, I've got stuck in a bit and I have a fairly good solution. But I ended up simplifying the CSS quite a lot, and possibly accidentally broke something. So I would appreciate anyone who is wiling to take a look and test it out. In summary, I got rid of all of the hard-coded px values and also the vw. Everything is now in em, except the font size of course. The js increases the font size when the screen gets wider, and everything else scales from that in the CSS by virtue of em. As I have it by default, the icons and fonts are a bit larger than before, which is my personal preference as I felt things were a little hard to see/read before. However there are some new config settings at the top of the scss so that can put this back. $rrssb-font-size = 11px, $rrssb-button-height = 3.3, $rrssb-icon-ratio 60% is maybe more like it was before. |
BTW my changes also include the fix for #128 |
PS The new CSS is %30 smaller (and I feel it's easier to understand) |
See above pull request, many thanks! |
I’m seeing this issue as well. Happy to help out in any way I can. I made this jsFiddle for easy testing. :) |
@adamschwartz I had it fixed in my fork, but that was based on top of other work that altered the appearance of the buttons, and so @dbox quite reasonably didn't want to take it. Unfortunately that code isn't there any more because I removed it in order to make the branch pure so another fix could be pulled. However it was actually pretty simple. The first part you have already done I'm guessing from your above note. Remove all the CSS with vw and pt sizing based on number of buttons. The second part is a js fix. In makeExtremityBtns, search down for self.addClass('large-format');. After that, add lines something like this: |
Sweet, thanks @AdamPS :) |
@AdamPS Is this a general fix? Or would you say this is just a workaround for non 100% width containers? |
I would definitely say it's a general fix - 100% width is probably not so common because of sidebars and so on. Of course need to test the fix works well at 100%, but I think it should. |
👍 |
Finally got a chance to look at this. I think this basic concept will work, we just need to tweak the sizing a little so there is no visual change. I've also be experimenting with element queries a little, which could be interesting. http://codepen.io/dbox/pen/adzLQb I'll get a fix for this pushed soon. |
@dbox Nice, looking forward to it ;) |
Almost everything is resized accurately, but the font size is a bit hit and miss. It uses vw with a fallback of pt. Why not calculate the exact best font size in the script?
pt is of course hard-coded so sometimes too big and sometimes too small
vw is relative to the viewport width - which could be very different from the container width
To see a worst possible ugly case, take the demo page, comment out all but 3 buttons, put width:25% on the buttons container and make the screen really wide. The font is way too big.
The text was updated successfully, but these errors were encountered: