Skip to content

fix(fonts): unquote unicode-range and font-display values #19511

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

Merged

Conversation

petersandor
Copy link
Contributor

@petersandor petersandor commented May 29, 2025

Closes #19298
Closes #19324

Changelog

Changed

  • unicode-range and font-display values are now without quotes

Testing / Reviewing

  1. Start any Carbon sample page with the styles loaded (fonts included) in Firefox
  2. Open developer tools and toggle CSS logging
  3. Check for console messages mentioning unknown descriptor in unicode-range and font-display

PR Checklist

As the author of this PR, before marking ready for review, confirm you:

  • Reviewed every line of the diff
  • [ ] Updated documentation and storybook examples
  • [ ] Wrote passing tests that cover this change
  • [ ] Addressed any impact on accessibility (a11y)
  • Tested for cross-browser consistency
  • Validated that this code is ready for review and status checks should pass

More details can be found in the pull request guide

@petersandor petersandor requested review from a team as code owners May 29, 2025 02:55
@petersandor petersandor requested review from Gururajj77 and emyarod May 29, 2025 02:55
@petersandor petersandor force-pushed the firefox-quoted-style-props branch from e3a7fb0 to 1f7704c Compare May 29, 2025 02:55
Copy link

netlify bot commented May 29, 2025

Deploy Preview for v11-carbon-web-components ready!

Name Link
🔨 Latest commit e3a7fb0
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-web-components/deploys/6837cc90910fa70008614f46
😎 Deploy Preview https://deploy-preview-19511--v11-carbon-web-components.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 project configuration.

Copy link

netlify bot commented May 29, 2025

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit e3a7fb0
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-react/deploys/6837cc90071f4400088ccb28
😎 Deploy Preview https://deploy-preview-19511--v11-carbon-react.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 project configuration.

Copy link

netlify bot commented May 29, 2025

Deploy Preview for v11-carbon-web-components ready!

Name Link
🔨 Latest commit 1f7704c
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-web-components/deploys/6837ccbd4f21e80008288dd3
😎 Deploy Preview https://deploy-preview-19511--v11-carbon-web-components.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 project configuration.

Copy link

netlify bot commented May 29, 2025

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 1f7704c
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-react/deploys/6837ccbd9ca83f00088a5af4
😎 Deploy Preview https://deploy-preview-19511--v11-carbon-react.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 project configuration.

Copy link

codecov bot commented May 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.48%. Comparing base (5581a0e) to head (1f7704c).
Report is 41 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #19511   +/-   ##
=======================================
  Coverage   84.48%   84.48%           
=======================================
  Files         373      373           
  Lines       14641    14641           
  Branches     4839     4843    +4     
=======================================
  Hits        12369    12369           
  Misses       2124     2124           
  Partials      148      148           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Gururajj77
Copy link
Contributor

image

Still seeing some warnings, and not able to test to make sure what's fixed. Can you please make the PR description a bit more elaborate.

@petersandor
Copy link
Contributor Author

petersandor commented May 29, 2025

image

Still seeing some warnings, and not able to test to make sure what's fixed. Can you please make the PR description a bit more elaborate.

@Gururajj77 The purpose of this fix is to remove quotes from unicode-range and font-display values only. I think that is made quite clear in the PR title and description. Compare it with the screenshots in the related issues.

Copy link
Member

@tay1orjones tay1orjones left a comment

Choose a reason for hiding this comment

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

Thanks for doing this! The web platform tests for the font face unicode range property showing exclusively unquoted strings (1, 2) confirms for me this is the right direction to take 👍

Comment on lines +123 to +131
$items: map.get($ranges, $name);
$count: list.length($items);
$result: '';

@for $i from 1 through $count {
$result: if($i == 1, '', $result + ', ') + list.nth($items, $i);
}

@return string.unquote($result);
Copy link
Member

Choose a reason for hiding this comment

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

Did you consider modifying the $ranges map above to contain unquoted strings instead of quoted strings? What you have here is fine, just curious if there's a tradeoff or blocker that pushed you in this direction. The sass docs mention CSS property values being a good time to use unquoted strings.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tay1orjones That was the first thing that I tried but it didn't seem to work, must've messed up on my side. I opened #19588 to revert this.

@kennylam kennylam added this pull request to the merge queue Jun 6, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 6, 2025
@kennylam kennylam added this pull request to the merge queue Jun 6, 2025
Merged via the queue into carbon-design-system:main with commit 348d58f Jun 6, 2025
37 checks passed
@petersandor petersandor deleted the firefox-quoted-style-props branch June 7, 2025 19:24
AlexanderMelox pushed a commit to AlexanderMelox/carbon that referenced this pull request Jun 10, 2025
…ign-system#19511)

* fix(fonts): unquote unicode-range and font-display values

Fixes carbon-design-system#19298

Fixes carbon-design-system#19324

* chore: added myself as a contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Firefox unknown descriptor in css @font-face rule [Bug]: Quoted values in font-face declarations skipped by Firefox
4 participants