-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 - 128px
spacing. - 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 |
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.
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 🙏 |
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 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-spacers
map to$spacer-map-extended
, and moving it tovariables/layout.scss
for use across all of primer, not only marketingy
axis (y
,t
,b
) with this map, just like the marketing utilities currently does$spacer-map-extended
map for allmargin
andpadding
core 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