Merge overlapping marketing spacing utilities into primer core#1372
Merge overlapping marketing spacing utilities into primer core#1372
Conversation
🦋 Changeset detectedLatest commit: 8eafb83 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Did we come to a conclusion in #1242? As far as I understood it:
- Pro for marketing: Fixes the "overriding" problem + reduces file size.
- Pro for product: Extended spacing scale with additional
48px - 128pxspacing. - Con for product: File size increase.
Re file size increase... Did a quick local test of dotcom:
| Before | After |
|---|---|
![]() |
![]() |
- Product pages (
frameworks.css) increase by +1.7kB. - Marketing pages (
frameworks.css + site.css) decrease by -1.9kb. Since it's not duplicated anymore.
So I would say maybe fine to move forward. 👍 Especially as a stop gap until we rethink all the spacing with https://github.com/github/primer/issues/41.
/cc @jonrohan @vdepizzol Any objections or concerns?
|
I realized that I had missed limiting the Edit: I made the same change in I've also drafted how these changes can be reflected in the documentation 🙏 it's worth noting that uniform padding utilities ( |
|
Here's an updated comparison with the latest changes (these numbers are not gzipped and in production, but rather the file sizes of the bundles on disk):
I.e. we're removing about |
simurai
left a comment
There was a problem hiding this comment.
Should we move all of marketing/utilities/margin.scss? It's almost not worth to keep the marketing margin utilities for only these two classes.
And I think the auto margin are handy even for product, we briefly considered that in https://github.com/github/design-systems/issues/550#issuecomment-460691862. Also lots of custom styled margin: 0 auto to center layouts.
Could also be a separate PR to keep this one focused.
That sounds reasonable to me. 👍 And we could add them back in case it gets requested a lot. |
…emove marketing/margin.scss completely
@simurai I did this now in a commit above to clean up this file completely ✨
This is also a fair point, I'd be happy to revert this last change, too, if we feel that we're including too much in this PR now 🙏 |
simurai
left a comment
There was a problem hiding this comment.
I'd be happy to revert this last change, too, if we feel that we're including too much in this PR now
Move sounds good for now. 👍 We can consider follow-up PRs to expand the auto margin a bit more. Like having a mx-auto or so.


Per discussion in #1242, this PR outlines a merge of the overlapping marketing spacing utilities into primer core. Method in brief:
$marketing-all-spacersmap to$spacer-map-extended, and moving it tovariables/layout.scssfor use across all of primer, not only marketingyaxis (y,t,b) with this map, just like the marketing utilities currently does$spacer-map-extendedmap for allmarginandpaddingcore utilities, but limiting the extended scale for X-axis margin utilities by checking for the length of the$spacer-map(@if ($scale < length($spacer-map)) { … })Todo