Skip to content
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

UI Kit v6: Update font-sizes #2505

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions scss/_reboot.scss
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@ small {
// Boosted mod
font-weight: $font-weight-normal;
line-height: $line-height-sm;

/* rtl:remove */
letter-spacing: 0;
// End mod
}

Expand Down
169 changes: 89 additions & 80 deletions scss/_type.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,82 +34,116 @@
@extend %heading;
}

.display-1 {
@include font-size($h2-font-size);
line-height: $h2-line-height;
h1 {
@include font-size(1.875rem);
line-height: calc(32 / 30); // stylelint-disable-line function-disallowed-list

/* rtl:remove */
letter-spacing: $h2-spacing;
letter-spacing: -.8px;
}

h1,
.display-2,
.display-3 {
h2,
.display-1 {
@include font-size($h3-font-size);
line-height: $h3-line-height;

/* rtl:remove */
letter-spacing: $mid-spacing;
letter-spacing: $h3-spacing;
}

/* rtl:begin:remove */
.display-2 {
letter-spacing: $h3-spacing;
}
@include font-size($h4-font-size);
line-height: $h4-line-height;

/* rtl:end:remove */
/* rtl:remove */
letter-spacing: $h4-spacing;
}

h2,
.display-4 {
h3,
.display-3,
.body-lg,
.label-lg {
@include font-size($h5-font-size);
line-height: $h5-line-height;

/* rtl:remove */
letter-spacing: $h5-spacing;
}

.body-md,
.label-md {
@include font-size($font-size-base);
line-height: $line-height-base;

/* rtl:remove */
letter-spacing: $letter-spacing-base;
}

.body-sm,
.label-sm {
@include font-size($font-size-sm);
line-height: $line-height-sm;

/* rtl:remove */
letter-spacing: 0;
}

.body-lg {
line-height: calc(26 / 18); // stylelint-disable-line function-disallowed-list
}

.body-md {
line-height: 1.5;
}

.body-sm {
line-height: calc(20 / 14); // stylelint-disable-line function-disallowed-list
}

.lead {
@include font-size($h6-font-size);
@include font-size($h5-font-size);
font-weight: $lead-font-weight;
line-height: $lead-line-height;
line-height: calc(26 / 18); // stylelint-disable-line function-disallowed-list

/* rtl:remove */
letter-spacing: $h6-spacing;
letter-spacing: $h5-spacing;
}

@include media-breakpoint-up(sm) {
h1,
.display-1,
.display-2,
.display-3 {
line-height: $display-line-height;
@include media-breakpoint-up(md) {
h1 {
@include font-size($h1-font-size);
line-height: $h1-line-height;

/* rtl:remove */
letter-spacing: $h1-spacing;
}

.display-1 {
@include font-size($display2-size);
@include font-size(2.5rem);
line-height: $display-line-height;

/* rtl:remove */
letter-spacing: $display2-spacing;
letter-spacing: -1px;
}

h2,
.display-2 {
@include font-size($display3-size);
@include font-size($h2-font-size);
line-height: $h2-line-height;

/* rtl:remove */
letter-spacing: $display3-spacing;
letter-spacing: $h2-spacing;
}

h1,
.display-3 {
@include font-size($display4-size);
@include font-size($display3-size);
line-height: $display-line-height;

/* rtl:remove */
letter-spacing: $display4-spacing;
letter-spacing: $display3-spacing;
}

h2,
h3,
.display-4 {
h3 {
@include font-size($h3-font-size);
line-height: $h3-line-height;

Expand All @@ -118,67 +152,50 @@ h2,
}

h4,
h5,
h6 {
h5 {
@include font-size($h5-font-size);
line-height: $h5-line-height;

/* rtl:remove */
letter-spacing: $h5-spacing;
}

.lead {
@include font-size($h5-font-size);

/* rtl:remove */
letter-spacing: $h5-spacing;
.body-lg {
@include font-size($font-size-xlg);
line-height: 1.5;
}
}

@include media-breakpoint-up(lg) {
.display-1 {
@include font-size($display1-size);
.body-md {
@include font-size($font-size-lg);
line-height: calc(26 / 18); // stylelint-disable-line function-disallowed-list

/* rtl:remove */
letter-spacing: $display1-spacing;
}

.display-2 {
@include font-size($display2-size);

/* rtl:remove */
letter-spacing: $display2-spacing;
}

.display-3 {
@include font-size($display3-size);

/* rtl:remove */
letter-spacing: $display3-spacing;
letter-spacing: $h5-spacing;
}

.display-4 {
@include font-size($display4-size);
line-height: $display-line-height;
.body-sm {
@include font-size($font-size-base);
line-height: 1.5;

/* rtl:remove */
letter-spacing: $display4-spacing;
letter-spacing: $letter-spacing-base;
}

h2 {
@include font-size($h2-font-size);
line-height: $h2-line-height;
.lead {
@include font-size($lead-font-size);
line-height: $lead-line-height;

/* rtl:remove */
letter-spacing: $h2-spacing;
letter-spacing: $lead-letter-spacing;
}
}

h3 {
@include font-size($h3-font-size);
line-height: $h3-line-height;
@include media-breakpoint-up(xl) {
.display-1 {
@include font-size($display1-size);

/* rtl:remove */
letter-spacing: $h3-spacing;
letter-spacing: $display1-spacing;
}

h4 {
Expand All @@ -189,21 +206,13 @@ h2,
letter-spacing: $h4-spacing;
}

h5,
h6 {
h5 {
@include font-size($h5-font-size);
line-height: $h5-line-height;

/* rtl:remove */
letter-spacing: $h5-spacing;
}

.lead {
@include font-size($lead-font-size);

/* rtl:remove */
letter-spacing: $lead-letter-spacing;
}
}
// End mod

Expand Down
30 changes: 14 additions & 16 deletions scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -754,8 +754,8 @@ $line-length-md: 80ch !default;

$letter-spacing-base: $spacer * -.005 !default; // -0.1px

$h1-font-size: $font-size-base * 2.125 !default; // 34px
$h2-font-size: $font-size-base * 1.875 !default; // 30px
$h1-font-size: $font-size-base * 3.125 !default; // 50px
$h2-font-size: $font-size-base * 2.125 !default; // 34px
$h3-font-size: $font-size-base * 1.5 !default; // 24px
$h4-font-size: $font-size-xlg !default; // 20px
$h5-font-size: $font-size-lg !default; // 18px
Expand All @@ -774,19 +774,19 @@ $font-sizes: (
// scss-docs-end font-sizes

// scss-docs-start letter-spacing
$h1-spacing: $letter-spacing-base * 10 !default; // -1px
$h2-spacing: $letter-spacing-base * 8 !default; // -0.8px
$h1-spacing: $letter-spacing-base * 16 !default; // -1.6px
$h2-spacing: $letter-spacing-base * 10 !default; // -0.8px
$mid-spacing: $letter-spacing-base * 6 !default; // -0.6px
$h3-spacing: $letter-spacing-base * 5 !default; // -0.5px
$h4-spacing: $letter-spacing-base * 4 !default; // -0.4px
$h4-spacing: $letter-spacing-base * 2 !default; // -0.2px
$h5-spacing: $letter-spacing-base * 2 !default; // -0.2px
$h6-spacing: $letter-spacing-base !default;
// $h6-spacing: $letter-spacing-base !default;
// scss-docs-end letter-spacing

// stylelint-disable function-disallowed-list
// scss-docs-start line-height
$h1-line-height: 1 !default;
$h2-line-height: calc(32 / 30) !default;
$h2-line-height: 1 !default;
$h3-line-height: calc(26 / 24) !default;
$h4-line-height: calc(22 / 20) !default;
$h5-line-height: calc(20 / 18) !default;
Expand All @@ -804,22 +804,20 @@ $headings-color: inherit !default;
// scss-docs-end headings-variables

// scss-docs-start display-headings
$display1-size: $font-size-xlg * 3 !default; // 60px
$display2-size: $font-size-xlg * 2.5 !default; // 50px
$display3-size: $font-size-xlg * 2 !default; // 40px
$display4-size: $h1-font-size !default; // 34px
$display1-spacing: $letter-spacing-base * 20 !default; // -2px
$display2-spacing: $letter-spacing-base * 16 !default; // -1.6px
$display3-spacing: $h1-spacing !default; // -1px
$display4-spacing: $h1-spacing !default; // -1px
$display1-size: $font-size-base * 3.125 !default; // 50px
$display2-size: $font-size-base * 2.125 !default; // 34px
$display3-size: $font-size-base * 1.75 !default; // 28px
$display1-spacing: $letter-spacing-base * 16 !default; // -1.6px
$display2-spacing: $letter-spacing-base * 10 !default; // -1px
$display3-spacing: $mid-spacing !default; // -0.6px
$display-line-height: $h1-line-height !default;
// scss-docs-end display-headings

// scss-docs-start type-variables
$lead-font-size: $font-size-xlg !default;
$lead-font-weight: 400 !default;
$lead-line-height: 1.5 !default;
$lead-letter-spacing: $letter-spacing-base * 4 !default;
$lead-letter-spacing: $letter-spacing-base * 2 !default;

$small-font-size: .875rem !default;

Expand Down
2 changes: 1 addition & 1 deletion site/assets/scss/_tarteaucitron.scss
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@

@include tac("H3", true) {
font-size: $h6-font-size;
letter-spacing: $h6-spacing;
letter-spacing: $letter-spacing-base;
}

@include tac("Info") {
Expand Down
Loading
Loading