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

[OUDS] Add "Font" tokens, utilities and documentation #2774

Merged
merged 31 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
6425606
tmp
louismaximepiton Nov 12, 2024
1dd77de
changed display classname and reordering of tables and small definition
vprothais Nov 12, 2024
e19d796
Some modifs + some OUDS mods
louismaximepiton Nov 12, 2024
60abb03
Add some OUDS mod, remove .initialism, add some documentation
louismaximepiton Nov 13, 2024
ff4b7fb
Thiner handle of OUDS mod + small tweaks of the doc.
louismaximepiton Nov 13, 2024
b52d72b
Adapting documentation with `px` and right values.
louismaximepiton Nov 13, 2024
ca6489b
First version with icon, missing links and the end of the icon page
louismaximepiton Nov 15, 2024
1b9667e
Remove '-web' from tokens, use mixin rather than extend, handle the i…
louismaximepiton Nov 18, 2024
bd6ef48
Fix ci
louismaximepiton Nov 18, 2024
c1b539d
Merge remote-tracking branch 'origin/ouds/main' into ouds/main-lmp-to…
louismaximepiton Nov 18, 2024
fe57462
Remove useless classes, Add font references everywhere, Add doc about…
louismaximepiton Nov 18, 2024
dd9517b
Merge remote-tracking branch 'origin/ouds/main' into ouds/main-lmp-to…
louismaximepiton Nov 19, 2024
74dfd3b
Small tweaks of font-stack
louismaximepiton Nov 19, 2024
602ac7e
Fix CI
louismaximepiton Nov 19, 2024
5de5703
migration guide (from v0.0.3)
hannahiss Nov 19, 2024
a006018
fix(review)
louismaximepiton Nov 20, 2024
abf01a6
Merge remote-tracking branch 'origin/ouds/main' into ouds/main-lmp-to…
louismaximepiton Nov 20, 2024
86c21c0
Align with mobile apps presentation
louismaximepiton Nov 20, 2024
245e5f9
css and sass vars and maps and mixins in both guides + first version …
hannahiss Nov 20, 2024
b7d1211
last fixes about bootstrap-compat migration doc
hannahiss Nov 20, 2024
298aa45
fix docs job (indentation)
hannahiss Nov 20, 2024
559bb00
Update site/content/docs/0.0/helpers/icon.md
hannahiss Nov 22, 2024
983fd91
Review migration guides and doc with LM
hannahiss Nov 22, 2024
305004d
Merge remote-tracking branch 'origin/ouds/main-lmp-tokens-font' into …
hannahiss Nov 22, 2024
fdaac34
Remove Label font-size classes
louismaximepiton Nov 25, 2024
49afd5e
Adding examples inside the doc, and small css tweaks
louismaximepiton Nov 25, 2024
cc71e9b
New ways to architect the icon + text
louismaximepiton Nov 26, 2024
1232b12
Adding migration guides
louismaximepiton Nov 26, 2024
6b6717f
fix(ci)
louismaximepiton Nov 26, 2024
899edd1
fix(design): after design review
louismaximepiton Nov 26, 2024
17917f9
Small tweak for forgotten `.text-*` and some spacings.
louismaximepiton Nov 27, 2024
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
16 changes: 8 additions & 8 deletions .bundlewatch.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"files": [
{
"path": "./dist/css/ouds-web-bootstrap.css",
"maxSize": "61.0 kB"
"maxSize": "62.75 kB"
},
{
"path": "./dist/css/ouds-web-bootstrap.min.css",
"maxSize": "58.0 kB"
"maxSize": "59.5 kB"
},
{
"path": "./dist/css/ouds-web-grid.css",
Expand All @@ -18,27 +18,27 @@
},
{
"path": "./dist/css/ouds-web-reboot.css",
"maxSize": "4.75 kB"
"maxSize": "5.75 kB"
},
{
"path": "./dist/css/ouds-web-reboot.min.css",
"maxSize": "4.5 kB"
"maxSize": "5.5 kB"
},
{
"path": "./dist/css/ouds-web-utilities.css",
"maxSize": "20.75 kB"
"maxSize": "22.25 kB"
},
{
"path": "./dist/css/ouds-web-utilities.min.css",
"maxSize": "19.75 kB"
"maxSize": "21.0 kB"
},
{
"path": "./dist/css/ouds-web.css",
"maxSize": "54.75 kB"
"maxSize": "56.25 kB"
},
{
"path": "./dist/css/ouds-web.min.css",
"maxSize": "51.5 kB"
"maxSize": "53.0 kB"
},
{
"path": "./dist/js/ouds-web.bundle.js",
Expand Down
3 changes: 3 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"clic",
"Codesniffer",
"combinator",
"Consolas",
"Contentful",
"Cpath",
"Crossfade",
Expand Down Expand Up @@ -70,6 +71,7 @@
"Lowercased",
"markdownify",
"mediaqueries",
"Menlo",
"minifiers",
"misfunction",
"mkdir",
Expand Down Expand Up @@ -155,6 +157,7 @@
"WCAG",
"whatsapp",
"WICG's",
"xlarge",
"zindex",
"بالعالم",
"مرحبًا"
Expand Down
1 change: 1 addition & 0 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ nuget/ouds-web.png
site/layouts/partials/icons.html
site/static/docs/**/assets/brand/orange-logo.svg
site/static/docs/**/assets/brand/orange-social.png
site/static/docs/**/assets/fonts/solaris-icons.woff2
site/static/docs/**/assets/img/favicons/android-chrome-192x192.png
site/static/docs/**/assets/img/favicons/android-chrome-512x512.png
site/static/docs/**/assets/img/favicons/apple-touch-icon.png
Expand Down
1 change: 1 addition & 0 deletions scss/_helpers.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
@import "helpers/color-bg";
@import "helpers/colored-links";
@import "helpers/focus-ring";
@import "helpers/icon";
@import "helpers/icon-link";
@import "helpers/ratio";
@import "helpers/position";
Expand Down
24 changes: 24 additions & 0 deletions scss/_maps.scss
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,30 @@ $ouds-elevations: (
) !default;
// scss-docs-end ouds-maps-elevations

// scss-docs-start ouds-maps-font
$ouds-font-sizes: (
cs: "/code-small",
louismaximepiton marked this conversation as resolved.
Show resolved Hide resolved
cm: "/code-medium",
bs: "/body-small",
bm: "/body-medium",
bl: "/body-large",
hs: "/heading-small",
hm: "/heading-medium",
hl: "/heading-large",
hxl: "/heading-xlarge",
ds: "/display-small",
dm: "/display-medium",
dl: "/display-large",
) !default;

$ouds-font-weights: (
normal: $ouds-font-weight-default,
bold: $ouds-font-weight-strong
) !default;

$ouds-icon-sizes: ("short", "medium", "tall") !default;
// scss-docs-end ouds-maps-font

// scss-docs-start ouds-maps-opacities
$ouds-opacities: (
"transparent": $ouds-opacity-transparent,
Expand Down
1 change: 1 addition & 0 deletions scss/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
@import "mixins/breakpoints";
@import "mixins/color-mode";
@import "mixins/color-scheme";
@import "mixins/fonts"; // OUDS mod
@import "mixins/image";
@import "mixins/resize";
@import "mixins/visually-hidden";
Expand Down
84 changes: 48 additions & 36 deletions scss/_reboot.scss
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
// 2. As a best practice, apply a default `background-color`.
// 3. Prevent adjustments of font size after orientation changes in iOS.
// 4. Change the default tap highlight to be completely transparent in iOS.
// 5. Prevent faux-bold/italic
// 5. Prevent faux-bold/italic especially for some RTL fonts
// See https://developer.mozilla.org/fr/docs/Web/CSS/font-synthesis

// scss-docs-start reboot-body-rules
Expand All @@ -69,11 +69,11 @@ body {
@include font-size(var(--#{$prefix}body-font-size));
font-weight: var(--#{$prefix}body-font-weight);
line-height: var(--#{$prefix}body-line-height);
// OUDS mod: no color
color: var(--#{$prefix}body-color);
text-align: var(--#{$prefix}body-text-align);

/* rtl:remove */
letter-spacing: $letter-spacing-base; // OUDS mod
letter-spacing: var(--#{$prefix}body-letter-spacing); // OUDS mod
background-color: var(--#{$prefix}body-bg); // 2
-webkit-text-size-adjust: 100%; // 3
-webkit-tap-highlight-color: rgba($black, 0); // 4
Expand Down Expand Up @@ -131,47 +131,52 @@ hr {
// By default, `<h1>`-`<h6>` all receive top and bottom margins. We nuke the top
// margin for easier control within type scales as it avoids margin collapsing.

// scss-docs-start ouds-font-implementation
%heading {
margin-top: 0; // 1
margin-bottom: $headings-margin-bottom;
@include font-size($font-size-base); // OUDS mod
font-family: $headings-font-family;
font-style: $headings-font-style;
font-weight: $headings-font-weight;
line-height: $headings-line-height;
color: var(--#{$prefix}heading-color);

/* rtl:remove */
letter-spacing: $letter-spacing-base; // OUDS mod
-webkit-font-smoothing: antialiased; // OUDS mod
-moz-osx-font-smoothing: grayscale; // OUDS mod
text-rendering: optimizelegibility; // OUDS mod
}

h1 {
@extend %heading;
@include font-size($h4-font-size);
line-height: $h4-line-height;
@include get-font-size("heading-xlarge"); // OUDS mod: instead of `@include font-size($h1-font-size)`
}

/* rtl:remove */
letter-spacing: $h4-spacing;
h2 {
@extend %heading;
@include get-font-size("heading-large"); // OUDS mod: instead of `@include font-size($h2-font-size)`
}

h2,
h3 {
@extend %heading;
@include font-size($h5-font-size);
line-height: $h5-line-height;
@include get-font-size("heading-medium"); // OUDS mod: instead of `@include font-size($h3-font-size)`
}

/* rtl:remove */
letter-spacing: $h5-spacing;
h4 {
@extend %heading;
@include get-font-size("heading-small"); // OUDS mod: instead of `@include font-size($h4-font-size)`
}

h5 {
@extend %heading;
@include get-font-size("body-large"); // OUDS mod: instead of `@include font-size($h5-font-size)`
}

h4,
h5,
h6 {
@extend %heading;
@include get-font-size("body-medium"); // OUDS mod: instead of `@include font-size($h6-font-size)`
}
// scss-docs-end ouds-font-implementation


// Reset margins on paragraphs
Expand All @@ -182,6 +187,7 @@ h6 {
p {
margin-top: 0;
margin-bottom: $paragraph-margin-bottom;
@include get-font-size("body-medium"); // OUDS mod
}


Expand All @@ -201,7 +207,7 @@ abbr[title] {
// Address

address {
margin-bottom: 1rem;
margin-bottom: $ouds-space-fixed-medium; // OUDS mod: instead of `1rem`
font-style: normal;
line-height: inherit;
}
Expand Down Expand Up @@ -283,9 +289,17 @@ dd {
// Blockquote

blockquote {
margin: 0 0 1rem;
margin: 0 0 $ouds-space-fixed-medium; // OUDS mod: instead of `0 0 1rem`
}

// OUDS mod: No italic
i,
em,
cite {
font-style: normal; // OUDS mod: remove italic.
}
// End mod


// Strong
//
Expand All @@ -303,11 +317,7 @@ strong {
// Add the correct font size in all browsers

small {
@include font-size($small-font-size);
// OUDS mod
font-weight: $font-weight-normal;
line-height: $line-height-sm;
// End mod
@include get-font-size("body-small"); // OUDS mod: instead of `@include font-size($small-font-size)`
}


Expand Down Expand Up @@ -381,10 +391,9 @@ samp {
pre {
display: block;
margin-top: 0; // 1
margin-bottom: 1rem; // 2
margin-bottom: $ouds-space-fixed-medium; // 2 // OUDS mod: instead of `1rem`
overflow: auto; // 3
@include font-size($code-font-size);
line-height: $pre-line-height; // OUDS mod
@include get-font-size("code-medium"); // OUDS mod: instead of `@include font-size($code-font-size)`
color: $pre-color;

// Account for some code outputs that place code tags in pre tags
Expand All @@ -399,7 +408,6 @@ var, // OUDS mod
code {
@include font-size($code-font-size);
font-style: normal; // OUDS mod: <var> is italic in all browsers
line-height: $line-height-sm; // OUDS mod
color: var(--#{$prefix}code-color);
word-wrap: break-word;

Expand All @@ -414,7 +422,7 @@ kbd {
@include font-size($kbd-font-size);
color: $kbd-color;
background-color: $kbd-bg;
@include border-radius($border-radius-sm);
@include border-radius($border-radius-sm, $border-radius-sm); // OUDS mod: instead of `@include border-radius($border-radius-sm)`

kbd {
padding: 0;
Expand Down Expand Up @@ -460,13 +468,10 @@ table {
caption {
padding-top: $table-caption-padding-y;
padding-bottom: $table-caption-padding-y;
@include font-size($h1-font-size); // OUDS mod
font-weight: $font-weight-bold; // OUDS mod
@include get-font-size("heading-xlarge"); // OUDS mod
font-weight: $font-weight-bold; // OUDS mod
color: $table-caption-color;
text-align: left;

/* rtl:remove */
letter-spacing: $h1-spacing; // OUDS mod
-webkit-font-smoothing: antialiased; // OUDS mod
-moz-osx-font-smoothing: grayscale; // OUDS mod
text-rendering: optimizelegibility; // OUDS mod
Expand Down Expand Up @@ -500,7 +505,6 @@ th {

label {
display: inline-block; // 1
font-weight: $form-label-font-weight; // OUDS mod
}

// Remove the default `border-radius` that macOS Chrome adds.
Expand Down Expand Up @@ -626,9 +630,9 @@ legend {
width: 100%;
padding: 0;
margin-bottom: $legend-margin-bottom;
@include font-size($legend-font-size);
font-weight: $legend-font-weight;
line-height: inherit;
// OUDS mod: no line-height
@include get-font-size("body-large"); // OUDS mod: instead of `@include font-size($legend-font-size)`

+ * {
clear: left; // 2
Expand Down Expand Up @@ -736,3 +740,11 @@ progress {
[hidden] {
display: none !important;
}

// OUDS mod
// Selection
::selection {
color: var(--#{$prefix}highlight-color);
background-color: var(--#{$prefix}highlight-bg);
}
// End mod
Loading
Loading