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

Reintroduce all text color utilities #2030

Merged
merged 56 commits into from
Jul 11, 2023
Merged

Conversation

hannahiss
Copy link
Member

@hannahiss hannahiss commented May 9, 2023

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

Related issues

Description

Reintroduce all text color utilities to conform to Bootstrap (and in particular within the dark mode) and allow developers to use text colors when needed, for SVG icons for example.
Add a design callout to explain it to developers and draw their attention to design specifications and accessibility requirements.

Motivation & Context

In the icons documentation, it is said to use text colors but they didn't exist anymore.

Types of change

  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would change existing functionality)

Live previews

Fix wording:

Doc, SCSS and examples (classes) changes:

  • https://deploy-preview-2030--boosted.netlify.app/docs/5.3/utilities/colors/
    • For the section "Colors", reverted to the original Bootstrap doc, and added a design callout asking to refer to "Orange's colors" section
    • Added "Orange's colors" section with some examples that comply with design and accessibility requirements (font size, color and background color defined altogether) by adding extra classes + explain accessibility rules
  • https://deploy-preview-2030--boosted.netlify.app/docs/5.3/helpers/colored-links/
    • Reverted to the original Bootstrap examples to have all color possibilities, and added "bg-dark" extra class when needed to comply with design and accessibility requirements, and added a design callout about links design
  • https://deploy-preview-2030--boosted.netlify.app/docs/5.3/utilities/link/
    • For the section "Colored links", reverted to the original Bootstrap examples to have all color possibilities, and added "bg-dark" extra class when needed to comply with design and accessibility requirements this section is about how to customize link opacity, underline opacity, and underline offset, and it is globally under a design callout saying it shouldn't be used)

Code of examples (markup or classes) changes, but doc and examples display remain exactly the same:

SCSS changes, but doc and examples remain exactly the same:

Checklist

Contribution

Accessibility

  • My change follows accessibility good practices; I have at least run axe

Design

  • My change respects the design guidelines defined in Orange Design System
  • (NA) My change is compatible with responsive display

Development

  • My change follows the developer guide
  • (NA) I have added JavaScript unit tests to cover my changes
  • I have added SCSS unit tests to cover my changes

Documentation

  • My change introduces changes to the documentation and/or I have updated the documentation accordingly

Checklist (for Core Team only)

  • My change introduces changes to the migration guide
  • (NA) My new component is added in Storybook
  • (NA) My new component is compatible with RTL
  • (NA) Manually run BrowserStack tests
  • (NA) Manually test browser compatibility with BrowserStack (Chrome >= 60, Firefox >= 60 (+ ESR), Edge, Safari >= 12, iOS Safari, Chrome & Firefox on Android)
  • Code review
  • Design review
  • A11y review

After the merge

@netlify
Copy link

netlify bot commented May 9, 2023

Deploy Preview for boosted ready!

Name Link
🔨 Latest commit e695e2b
🔍 Latest deploy log https://app.netlify.com/sites/boosted/deploys/64ad5485284a6e0008a0a38d
😎 Deploy Preview https://deploy-preview-2030--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.

@julien-deramond
Copy link
Member

julien-deramond commented May 30, 2023

For now, we have still problems to solve on dark variants on :

* https://deploy-preview-2030--boosted.netlify.app/docs/5.3/components/alerts/#dark-variant

* https://deploy-preview-2030--boosted.netlify.app/docs/5.3/components/buttons/#dark-variant

* https://deploy-preview-2030--boosted.netlify.app/docs/5.3/components/dropdowns/#dark-dropdowns

* https://deploy-preview-2030--boosted.netlify.app/docs/5.3/components/footer/#example

* https://deploy-preview-2030--boosted.netlify.app/docs/5.3/components/navbar/

* https://deploy-preview-2030--boosted.netlify.app/docs/5.3/components/orange-navbar/#with-title

* https://deploy-preview-2030--boosted.netlify.app/docs/5.3/components/spinners/#colors

* https://deploy-preview-2030--boosted.netlify.app/docs/5.3/components/tags/#dark-variant

* https://deploy-preview-2030--boosted.netlify.app/docs/5.3/components/title-bars/#background-color

Normal text is black on black, we have to think about how to change its color with keeping this version's logic...

Haven't tested in detail, but you might want to try the following:

diff --git a/scss/_root.scss b/scss/_root.scss
index fd17dcdbd..39fa00853 100644
--- a/scss/_root.scss
+++ b/scss/_root.scss
@@ -158,6 +158,7 @@
   --#{$boosted-prefix}kbd-color: #{$kbd-color-inverted};
   --#{$boosted-prefix}kbd-bg: #{$kbd-bg-inverted};
   --#{$boosted-prefix}pre-color: #{$pre-color-inverted};
+  --#{$prefix}body-color: #{$body-color-dark};
 
   // stylelint-disable-next-line scss/selector-no-redundant-nesting-selector
   [class*="bg-"]:not(&):not(.bg-transparent) {
@@ -175,6 +176,7 @@
     --#{$boosted-prefix}kbd-color: #{$kbd-color};
     --#{$boosted-prefix}kbd-bg: #{$kbd-bg};
     --#{$boosted-prefix}pre-color: #{$pre-color};
+    --#{$prefix}body-color: #{$body-color};
   }
 }
 // End mod

Plus, for example, adding the definition for --#{$prefix}heading-color, etc. if needed.

And we will probably be able to completely remove dark variants handling in this _root.scss with the dark mode when it'll be fully implemented.

- change doc on colors (text-primary now turns to the right orange on dark-bg - again)
- fix pbs on dark variants by changing color of body-color and heading-color on dark-bg
- fix pb on buttons no-outline btn-inverse on hover
- fix pb on navbar titles on hover
- fix pbs on tag dark variants
- change doc on spinners (use no class on light and text-white and no
- adapt backgrounds and text colors in utilities
@hannahiss
Copy link
Member Author

hannahiss commented May 31, 2023

@julien-deramond
Last changes:

  • change doc on colors (text-primary now turns to the right orange on dark-bg - again)
  • fix pbs on dark variants by changing color of body-color and heading-color on dark-bg
  • fix pb on buttons no-outline btn-inverse on hover
  • fix pb on navbar titles on hover
  • fix pbs on tag dark variants
  • change doc on spinners (use no class on light and text-white and no
  • adapt backgrounds and text colors in utilities

Remaining pbs & questions;

scss/_maps.scss Outdated Show resolved Hide resolved
- cards: move text-bg-** to card-body
- fix wording in docs (belong to)
- colored-links in helpers and utilities: restore all the links colors, add bg-dark when needed, add design callout, restore accessibility tip
- maps: remove light not needed (already in theme colors)
@hannahiss hannahiss marked this pull request as ready for review June 5, 2023 07:35
@hannahiss hannahiss added the v5 label Jun 5, 2023
Copy link
Member

@louismaximepiton louismaximepiton left a comment

Choose a reason for hiding this comment

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

⚠️ There's an issue with the footer examples / doc, the copyright / text isn't visible. ⚠️

I'll review the migration guide once it's done.

scss/_variables-dark.scss Show resolved Hide resolved
scss/_alert.scss Show resolved Hide resolved
scss/_tags.scss Show resolved Hide resolved
site/content/docs/5.3/helpers/colored-links.md Outdated Show resolved Hide resolved
site/content/docs/5.3/utilities/colors.md Show resolved Hide resolved
site/content/docs/5.3/utilities/colors.md Outdated Show resolved Hide resolved
site/content/docs/5.3/utilities/colors.md Outdated Show resolved Hide resolved
site/content/docs/5.3/utilities/colors.md Outdated Show resolved Hide resolved
site/content/docs/5.3/utilities/colors.md Outdated Show resolved Hide resolved
site/content/docs/5.3/utilities/colors.md Show resolved Hide resolved
- use theme-colors.yml to add bg-dark when needed on texts and links in utilities
- fix and enhance wordings in docs
- forgotten bg-dark with text-white
- add more icons colors combinations examples
scss/_maps.scss Outdated Show resolved Hide resolved
scss/_variables-dark.scss Outdated Show resolved Hide resolved
scss/_variables.scss Show resolved Hide resolved
scss/_variables.scss Show resolved Hide resolved
site/content/docs/5.3/helpers/colored-links.md Outdated Show resolved Hide resolved
site/content/docs/5.3/helpers/colored-links.md Outdated Show resolved Hide resolved
site/content/docs/5.3/utilities/link.md Outdated Show resolved Hide resolved
@julien-deramond

This comment was marked as resolved.

@julien-deramond

This comment was marked as resolved.

@julien-deramond

This comment was marked as resolved.

@julien-deramond

This comment was marked as resolved.

@julien-deramond

This comment was marked as resolved.

hannahiss and others added 2 commits July 11, 2023 10:57
Co-authored-by: Julien Déramond <julien.deramond@orange.com>
Co-authored-by: Julien Déramond <julien.deramond@orange.com>
@sonarcloud
Copy link

sonarcloud bot commented Jul 11, 2023

Please retry analysis of this Pull-Request directly on SonarCloud.

@sonarcloud
Copy link

sonarcloud bot commented Jul 11, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@julien-deramond julien-deramond self-requested a review July 11, 2023 13:53
Copy link
Member

@julien-deramond julien-deramond left a comment

Choose a reason for hiding this comment

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

:shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to documentation feature passed design review utilities v5
Projects
Development

Successfully merging this pull request may close these issues.

4 participants