-
Notifications
You must be signed in to change notification settings - Fork 163
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
Spacing refactor rebased on the 3.0 feature branch #3971
Conversation
Demo starting at https://vanilla-framework-3971.demos.haus |
@bartaz @sowasred2012 I think this is ready for review. Haven't ticked all the checkboxes as I am not sure whether they apply to the 3.0 feature branch, if they do I'll add those changes too, just let me know please. |
remove some morre variables that are not needed add some clarifications and remove unnecessary var test change to see if percy works on this branch convert some remaining vars fix-typo update spacing md file remove unneeded markup fix table explanations fix typo fix tyypo
0f70420
to
f8c0aca
Compare
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.
Looks good, and Percy passes - just one question about the code.
scss/_patterns_pagination.scss
Outdated
margin-left: -#{$sph--small}; | ||
} | ||
|
||
&:last-child { | ||
margin-right: -#{$sph-inner--small}; | ||
margin-right: -#{$sph--small}; |
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.
Is interpolation needed in these cases? There's an example of a negative variable in another file in this PR here that doesn't use interpolation
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.
I don't know why GH won't allow me to add a suggested change here, but yes, this interpolation could be removed.
scss/_patterns_side-navigation.scss
Outdated
margin-left: -#{$sph--small}; | ||
margin-right: $sph--small; |
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.
Same question re: interpolation
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.
Looks great, thanks! Couple minor suggestions in inline comments.
scss/_patterns_pagination.scss
Outdated
margin-left: -#{$sph--small}; | ||
} | ||
|
||
&:last-child { | ||
margin-right: -#{$sph-inner--small}; | ||
margin-right: -#{$sph--small}; |
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.
I don't know why GH won't allow me to add a suggested change here, but yes, this interpolation could be removed.
@@ -7,70 +7,60 @@ context: | |||
# Spacing | |||
|
|||
<hr> | |||
Spacing in Vanilla is controlled via a set of variables. There are two kinds of variables - nudges, which keep text aligned to the baseline grid, and multiples of the spacing unit, which define vertical and horizontal spacing. |
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.
Any reason why you list "nudges" always before standard 'multiples' spacing?
I think it would be clearer to do the opposite. The default (and easier to understand) are the spacing unit based variables, only if something doesn't align to baseline it uses nudges.
So in case of this sentence:
Spacing in Vanilla is controlled via a set of variables. There are two kinds of variables - nudges, which keep text aligned to the baseline grid, and multiples of the spacing unit, which define vertical and horizontal spacing. | |
Spacing in Vanilla is controlled via a set of variables. There are two kinds of variables - multiples of the spacing unit, which define vertical and horizontal spacing. and nudges, which keep text aligned to the baseline grid. |
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.
Precisely because they are more likely to be overlooked - especially if left after a second "and". they are also the firsrt things thst need to be set right, otherwise nothing would align to the baseline grid, and the multiples would be pointless.
|
||
Vanilla uses a default spacing unit of `.5rem` (`8px`) as a basis to calculate spacing inside and between components, as well as the line-heights of the different type sizes. | ||
- text baselines are "nudged" until they fall precisely on the grid | ||
- any margin, padding or other positioning happens in multiples of the baseline grid spacing unit. |
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.
I'd move this up above the point with nudges.
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.
The nudges is what makes vertical rhythm work, I don't want them to feel like an optional final step - that's why I always put it at the top.
- text baselines are "nudged" until they fall precisely on the grid | ||
- any margin, padding or other positioning happens in multiples of the baseline grid spacing unit. | ||
|
||
## Nudges |
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.
I'd move the nudge section down to the bottom after other spacing is defined.
Co-authored-by: Bartek Szopka <83575+bartaz@users.noreply.github.com>
Co-authored-by: Bartek Szopka <83575+bartaz@users.noreply.github.com>
Co-authored-by: Bartek Szopka <83575+bartaz@users.noreply.github.com>
Co-authored-by: Bartek Szopka <83575+bartaz@users.noreply.github.com>
Co-authored-by: Bartek Szopka <83575+bartaz@users.noreply.github.com>
Co-authored-by: Bartek Szopka <83575+bartaz@users.noreply.github.com>
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.
Great work, thanks!
Co-authored-by: Bartek Szopka <83575+bartaz@users.noreply.github.com>
This reverts commit 540865f.
Co-authored-by: Bartek Szopka <83575+bartaz@users.noreply.github.com>
Co-authored-by: Bartek Szopka <83575+bartaz@users.noreply.github.com>
Co-authored-by: Bartek Szopka <83575+bartaz@users.noreply.github.com>
Co-authored-by: Bartek Szopka <83575+bartaz@users.noreply.github.com>
Co-authored-by: Bartek Szopka <83575+bartaz@users.noreply.github.com>
Co-authored-by: Bartek Szopka <83575+bartaz@users.noreply.github.com>
Co-authored-by: Bartek Szopka <83575+bartaz@users.noreply.github.com>
Co-authored-by: Bartek Szopka <83575+bartaz@users.noreply.github.com>
Done
[List of work items including drive-bys]
Fixes https://github.com/canonical-web-and-design/vanilla-squad/issues/1104
QA