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 text color utilities to the Colors tokens PR #2830

Open
wants to merge 3 commits into
base: ouds/main-lmp-tokens-colors
Choose a base branch
from

Conversation

louismaximepiton
Copy link
Member

@louismaximepiton louismaximepiton commented Dec 27, 2024

Note: Please transform - [ ] into - (NA) in the description when things are not applicable

Related issues

NA

Description

Remaining tasks and questions

⚠️ Questions:

  • Do we keep colored links aligned with our text colors or not ?
  • Do we keep the dark mode for colored links (coming from Boosted legacy) ?
  • Do we keep all the utilities or do we keep only a few of them ?

Tasks:

Done list

The following was done in the PR:

  • Changed all the .text- color occurrences in the documentation
  • Introduced all the text color utilities and the corresponding documentation
  • Changed all the color properties in the Scss
  • Minor adapted the Scss variables
  • Introduced the colored links and the corresponding documentation
  • Tweaked a bit the callouts in the documentation
  • Uncommented some links in the doc
  • Added some new SVGs
  • Added text colors tests

To be done after the PR is merged

  • Uncomment things when Links are defined.
  • Uncomment things when Link utilities will be developed.

Motivation & Context

Types of change

  • New feature (non-breaking change which adds functionality)

Live previews

@louismaximepiton louismaximepiton added docs Improvements or additions to documentation css labels Dec 27, 2024
@louismaximepiton louismaximepiton added this to the OUDS milestone Dec 27, 2024
@louismaximepiton louismaximepiton force-pushed the ouds/main-lmp-tokens-colors-border-utilities branch from 10b3d2a to 741f161 Compare December 30, 2024 08:31
@louismaximepiton louismaximepiton force-pushed the ouds/main-lmp-tokens-colors-text-utilities branch from 2ca8c15 to d44a18d Compare December 30, 2024 08:34
@louismaximepiton louismaximepiton changed the base branch from ouds/main-lmp-tokens-colors-border-utilities to ouds/main-lmp-tokens-colors-bg-utilities December 30, 2024 08:35
@louismaximepiton louismaximepiton force-pushed the ouds/main-lmp-tokens-colors-text-utilities branch 2 times, most recently from e0ad436 to b3965bc Compare January 3, 2025 13:26
Base automatically changed from ouds/main-lmp-tokens-colors-bg-utilities to ouds/main-lmp-tokens-colors January 6, 2025 10:19
@louismaximepiton louismaximepiton force-pushed the ouds/main-lmp-tokens-colors-text-utilities branch from b3965bc to 2c8b907 Compare January 6, 2025 15:45
Copy link

netlify bot commented Jan 6, 2025

Deploy Preview for boosted ready!

Name Link
🔨 Latest commit 664b27f
🔍 Latest deploy log https://app.netlify.com/sites/boosted/deploys/678a3659f908540008d8859f
😎 Deploy Preview https://deploy-preview-2830--boosted.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@louismaximepiton louismaximepiton force-pushed the ouds/main-lmp-tokens-colors-text-utilities branch from 2c8b907 to a11c9b3 Compare January 6, 2025 15:54
@louismaximepiton louismaximepiton marked this pull request as ready for review January 6, 2025 16:06
@louismaximepiton louismaximepiton force-pushed the ouds/main-lmp-tokens-colors-text-utilities branch 5 times, most recently from 6b27bac to 77424c7 Compare January 8, 2025 17:31
@louismaximepiton louismaximepiton force-pushed the ouds/main-lmp-tokens-colors-text-utilities branch from 77424c7 to da1f218 Compare January 9, 2025 09:46
To be sure to respect the specifications, it is necessary to define `color`, `background-color` and `font-size` altogether.

Thus, the `.text-brand-primary` color on light background (`#f15e00`) should only be used in a font size greater than 24px (using for example `.fs-ds` utility), or 19px bold (using for example `.fs-hm` and `.fw-bold` utilities).
The `.text-primary` color on dark background (`#ff7900`) can be used in any size, and it shouldn't be used on light grey backgrounds at all.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

text-primary doesn't exist in OUDS. It should be text-brand-primary I think. This color can be used on any background color If I remember well.

- **Normal texts** are the remaining texts references.
{{< /callout >}}

In the next table we assume that the background is used in a color mode switching context and that the associated theme is good, so we have to consider the light and dark mode for the text color.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

next should be replaced by following here. But I find the whole sentence a bit complicated. Maybe we should just say that the table take into account the light/dark mode switch with good use of bs-theme on container ? (If it's what you mean)

In the next table we assume that the background is used in a color mode switching context and that the associated theme is good, so we have to consider the light and dark mode for the text color.

{{< bs-table >}}
| Color utility | Allowed `.bg-*` utility for normal text | Allowed `.bg-*` utility for large text |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid repetition of colors between normal text and large text, we may change the title of the second column for "Allowed .bg-* utility for normal and large text". So any color in this column is implicitely ok on large and we have on the third column only what change in regard of the second column.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might need to change also the title of the third column for something like "Allowed .bg-* utility for large text only".
Not sure if it's clear enough tho.


<!-- ## Opacity -->

## Specificity
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure to understand this section. Is it linked to the !important on text helpers ?

Most `color` utilities are generated by our theme colors, reassigned from our generic color palette variables.

<!-- Boosted mod -->
Boosted supersedes Bootstrap color variables with Orange brand color.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reference to Boosted should be renamed


Most `color` utilities are generated by our theme colors, reassigned from our generic color palette variables.

<!-- Boosted mod -->
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reference to Boosted should be changed


{< scss-docs name="brand-colors" file="scss/_variables.scss" >}}

{< scss-docs name="brand-colors-dark" file="scss/_variables-dark.scss" >}}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

brand-colors and brand-colors-dark does not seems to work on the page deployed on netlify

{{< /callout >}}

{{< callout info >}}
**Heads up!** `.link-body-emphasis` is currently the only colored link that adapts to color modes. It's treated as a special case until v6 arrives and we can more thoroughly rebuild our theme colors for color modes. Until then, it's a unique, high-contrast link color with custom `:hover` and `:focus` styles. However, it still responds to the new link utilities.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we specify that we talk about the v6 of bootstrap. Since we don't share the same version number, It may be v2 or v3 for us. We are in a bootstrap compatibility section so I don't know if it's obvious or not.

<!--```html
<p class="text-danger">
```html
<p class="text-status-negative">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find this example a bit weird. If I use a screen reader, I can't see the color red. And If I don't use a screen reader the text is not displayed, so why would we make it red ! Furthermore we don't have the right to use this helper class for text, only for icon :)

Copy link
Collaborator

@vprothais vprothais left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I've reviewed all files at last !


li li li::marker { color: var(--#{$prefix}tertiary-color); }
li li li::marker { color: var(--#{$prefix}color-content-disabled); }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to add this requirement in Figma for the bullet list component but we don't have the figma file yet. Should we add a "todo" comment here to not forget to talk about list in list with designer ?

@@ -16,6 +16,7 @@
}

// OUDS mod
// TODO LM: Decide if we keep the dark mode or not
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current result on netlify seems good to me. What would it imply not to keep it ?

@@ -141,15 +141,14 @@ The `<hr>` element has been simplified. Similar to browser defaults, `<hr>`s are
{{< example >}}
<hr>

<div class="text-status-positive">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we keep this color as an example since it's not allowed to have green border ?

The sentence on line 139 talks about a 0.25 opacity. That's not true in OUDS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css docs Improvements or additions to documentation
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants