pybricks / pybricks-api

User API and documentation for Pybricks MicroPython
https://pypi.org/project/pybricks
MIT License
80 stars 23 forks source link

doc/common/extensions: Separate checkmark from image. #127

Closed laurensvalk closed 1 year ago

laurensvalk commented 1 year ago

This makes it easier to see when the images are small.

Fixes: https://github.com/pybricks/support/issues/838

image

image


This still needs better CSS:

I spent too long messing around to get it to look better, but I must be missing something. Any ideas @dlech ?

dlech commented 1 year ago

It would be nice if we could use icons that have a consistent visual style. The readthedocs theme ships with fontawsome, so we could those if we want to use font icons.

dlech commented 1 year ago

I spent too long messing around to get it to look better, but I must be missing something.

I think the background-origin: content-box; style is what you are looking for.

And instead of the :after selector, just style the height of the <th> in vw units.

dlech commented 1 year ago

Maybe something like:

.requirements-table td {
    background-size: contain;
    background-repeat: no-repeat;
    background-origin: content-box;
    vertical-align: top !important;
    text-align: right;
    min-width: 100px;
    width: 6vw;
    height: 4vw;
}

(dropping all of the other styles)

laurensvalk commented 1 year ago

I think the background-origin: content-box; style is what you are looking for.

That's the one I started with, but it came out with much bigger margin/padding, leaving not much to see on small screens.

And instead of the :after selector, just style the height of the in vw units.

I was hoping we could have square cells no matter the number of hubs, but I suppose we can just hard code and change it when we add more.

Maybe something like:

Thanks, but we can't quite merge this yet :)

image

I'm just going to go for the simple solution so we have something for the release.

laurensvalk commented 1 year ago

I'm just going to go for the simple solution so we have something for the release.

I just used the compatibility icons we already had, minus the checkmarks, but with the margin they already had.