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

fix: deploy URL not set right for all CSS url references (e.g. fonts) #1521

Merged
merged 1 commit into from Oct 19, 2023

Conversation

shauke
Copy link
Member

@shauke shauke commented Oct 18, 2023

PR Type

[x] Bugfix

What Is the Current Behavior?

With the setting

DEPLOY_URL: '/extranet/'

and font definition in the SCSS files like this

/* Helvetica Neue Condensed Heavy - latin */
@font-face {
  font-family: 'HelveticaNeue-CondensedBold';
  font-style: normal;
  font-weight: 400;
  src: local('HelveticaNeue-CondensedBold '),
    //  Super Modern Browsers
    url('/assets/fonts/HelveticaNeueBold.woff2') format('woff2'),
    // Modern Browsers
    url('/assets/fonts/HelveticaNeueBold.woff') format('woff');
  font-display: swap;
}

/* Helvetica Neue Condensed - latin */
@font-face {
  font-family: 'HelveticaNeue-Condensed';
  font-style: normal;
  font-weight: 400;
  src: local('HelveticaNeue-Condensed '),
    //  Super Modern Browsers
    url('/assets/fonts/HelveticaNeueNormal.woff2') format('woff2'),
    // Modern Browsers
    url('/assets/fonts/HelveticaNeueNormal.woff') format('woff');
  font-display: swap;
}

The resulting CSS (checked inside the browser) is:

@font-face{font-family:HelveticaNeue-CondensedBold;font-style:normal;font-weight:400;src:local("HelveticaNeue-CondensedBold "),
url(/assets/fonts/HelveticaNeueBold.woff2) format("woff2"),url(/extranet/assets/fonts/HelveticaNeueBold.woff) format("woff");font-display:swap}
 
@font-face{font-family:HelveticaNeue-Condensed;font-style:normal;font-weight:400;src:local("HelveticaNeue-Condensed "),
url(/extranet/assets/fonts/HelveticaNeueNormal.woff2) format("woff2"),url(/extranet/assets/fonts/HelveticaNeueNormal.woff) format("woff");font-display:swap}

So at the very first font the /extranet is missing in front of /assets.
We have changed the order of the fonts inside the SCSS. Always the first font is affected.

What Is the New Behavior?

  • deploy URL was falsely set for url(data: references - this is no longer the case
  • the matcher selected url(data references and included the first url(/assets/ in this match so it was not treated separately failing to add the deploy URL for the first assets URL after a data URL - this is no longer the case

Does this PR Introduce a Breaking Change?

[x] No

Other Information

AB#90317

* deploy URL was falsely  set for `url(data:` references
* the matcher selected `url(data` references and included the first `url(/assets/` in this match so ist was not treated seperatly failing to add the deploy URL
@shauke shauke added this to the 5.0 milestone Oct 18, 2023
@shauke shauke self-assigned this Oct 18, 2023
@shauke shauke added the bug Something isn't working label Oct 18, 2023
@shauke shauke merged commit e6d4dfb into develop Oct 19, 2023
24 checks passed
@shauke shauke deleted the bugfix/deployurl_for_css_resources branch October 19, 2023 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants