Type scale > Implement type scale specs
Description
This issue is to make the type scale and heading specs available in gitlab-ui. Alongside this effort there will be additional work needed to integrate these values into the product. The changes here are backwards compatible, unless otherwise noted.
Proposal
I propose the following MRs in the following order:
-
✅ Add size scale and heading mixins -
✅ Add heading scale classes -
✅ Update avatar scale -
✅ Update modal scale -
✅ Update popover scale -
✅ Update banner scale -
✅ Update alert scale -
✅ Update markdown scale - Update drawer scale
⚠ ️ - Update card scale
⚠ ️ -
👀 Update usage docs - Remove old stuff
✅ Add size scale and heading mixins
See changes to /scss/
in !3586 (diffs)
MR: feat(Typography): Add font-size variable map an... (!3673 - merged)
- Update size variables to css map
- Create function to turn a number into a font-size variable
- Create mixin to apply heading styles based on font-size
Create mixins to match headings styles to h1–h6
✅ Add heading scale classes
Note: I forgot to do this in !3673 (merged)
MR: feat(Typography): Add heading scale classes (!3685 - merged)
- Create mixins to match headings styles to h1–h6
- Create mixins for contextual adjustments
✅ Update avatar scale
See changes to /src/components/base/avatar/avatar.scss
in !3586 (diffs)
MR: feat(Avatar): Use font size scale (!3679 - merged)
- Update sizes to use the css map
- Remove unnecessary styles
✅ Update modal scale
See changes to src/components/base/modal/
in !3586 (diffs)
MR: feat(Modal): Use current styles and h2 for heading (!3681 - merged)
- Update semantics to
h2
- Use -500 heading mixin
- Remove unnecessary styles
✅ Update popover scale
See changes to src/components/base/popover/popover.scss
in !3586 (diffs)
MR: feat(Popover): Use heading scale (!3695 - merged)
- Use -200 heading mixin
- Remove unnecessary styles
✅ Update banner scale
MR: feat(Banner): Update heading to use heading scale (!3698 - merged)
See changes to src/components/base/banner/banner.scss
in !3586 (diffs)
This is the first change I expect to be met with strong opinions and to appear in #is-this-known
- Use -500 heading mixin
- Remove unnecessary styles
✅ Update alert scale
MR: feat(Alert): Use heading scale (!3706 - merged)
See changes to src/components/base/alert/alert.scss
in !3586 (diffs)
I expect to be met with strong opinions and to appear in #is-this-known. This change will make alert suitable in less places, which is intentional and matches how the component should be used.
- Use -500 heading mixin
- Remove unnecessary styles
✅ Update markdown scale
MR: feat(GlMarkdown): Use heading scale (!3965 - merged)
See changes to src/components/base/markdown/markdown.scss
in !3586 (diffs)
.md
in GitLab for parity
- Use heading mixins
- Remove heading underline
- Remove unnecessary styles
⚠ ️
Update drawer scale See changes to src/components/base/drawer/
in !3586 (diffs)
This is our first breaking change and requires integration. Proposed order:
- Add styles to gitlab-ui
- Set styles and update semantics to
h2
in product - Set semantics at component level in gitlab-ui (as seen in !3586 (diffs))
- Integration branch to remove semantics from product
⚠ ️
Update card scale This one is challenging as cards can be different semantics depending on usage.
Potential plan - set a card-heading mixin that implementors can apply? But open to suggestions for this one.
In !3586 (diffs) I set the size manually, but this felt icky. I'd love it if usage of those mixins was locked to the semantic element. That is, gl-heading-3
would object to being applied to a h4
.
👀 Update usage docs
We should update the docs https://gitlab-org.gitlab.io/gitlab-ui/?path=/docs/scss-typescale--docs
Remove old stuff
Once migration is complete we should remove the old stuff. I suspect we'll create a new issue to track this.
Figma file
Checklist
Make sure the following are completed before closing the issue:
-
Assign the correct component label to this issue. -
Create an MR with the additions or updates needed. -
Be sure to get your MR reviewed by a FE/UX Foundations designer. -
When applicable, create an MR in Pajamas to update the demos. If you do not have capacity to complete the demos, create an issue in Pajamas and bring the issue to your team planning session for prioritization and scheduling. Mark the issue as related to this one. -
When applicable, create an MR in Pajamas to update the component status. -
When applicable, create an issue in Pajamas using the "Component Documentation" issue template to update guidelines. Ping a designer on your team for awareness and bring the issue to your team planning meeting for prioritization and scheduling. -
When applicable, create an issue in Pajamas using the "Figma update" issue template to update the Figma UI Kit. Ping a designer on your team for awareness and bring the issue to your team planning meeting for prioritization and scheduling. -
When introducing a major or breaking change, communicate the changes within the Engineering Week in Review. -
🎉 Congrats, you made it! You can now close this issue.