-
Notifications
You must be signed in to change notification settings - Fork 165
Corrected column math in galleries - issue #91 #130
Conversation
contributor: technosiren
How do I test this with the other CSS changes? |
Either copy over _galleries.scss into your working directory and run sass, or copy over the compiled style.css from this branch to test with? |
Yeah, so I'd have to do that for the other changes too, to test them together... |
Not if you first checkout my branch with the fix into your working directory - then you're testing only the code in that branch. |
I know how to test one at a time. I'm trying to test them together. |
Sorry, maybe posting links to the issues you're trying to test with would help - I can either merge my fixes with those or we can ask @kjellr for testing guidance. |
Which other changes are you trying to test this with, @joyously? In general, we tend to test changes one at a time, within individual branches. |
I believe those are coming from Gutenberg, however I have not yet been able to duplicate them.
|
Ok, thanks. I don't see any specific code changes in those issues, so I'm not sure what CSS would've been changed on your end. In any case, this may be a product of our missing process/documentation for working with Sass while we're sorting out whether we'll be using it for sure. @allancole and I are aiming to sort that out ASAP to prevent future confusion. |
@allancole @kjellr this one is finally conflict-free and ready to go. |
Yup, this looks good @briannaorg. Thanks for contributing! ;-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, this math is much better 👍
contributor: technosiren
If columns are being displayed inside .entry-content, as in the gallery use case, then vw is not the correct unit of measure for the column map because the entire viewport isn't available. I switched the columns map to use percentages instead, so it's sized to its container.
As pretty as the column map is in _columns.scss, the math doesn't actually work.
A single-column gallery is not equivalent to a single column width - it's equal to 12 column widths. I adjusted the math in the loop inside _galleries.scss to accommodate this, and update the map key in _columns.scss to accommodate decimal values for the actual widths required.
While testing, I discovered that the values returned for the 7 and 9 column galleries weren't mappable due to decimal places. So I ended up eliminating the columns map entirely from _galleries.scss and left it as the original map with viewport units, not currently in use.