Skip to content

feat: fonts csp #12103

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

feat: fonts csp #12103

wants to merge 3 commits into from

Conversation

florian-lefebvre
Copy link
Member

@florian-lefebvre florian-lefebvre commented Jul 31, 2025

Description (required)

Document new APIs that allow fonts to work with csp

Related issues & labels (optional)

  • Closes #
  • Suggested label:

For Astro version: ???. See astro PR #14154.

(Doesn't require a minor, but won't be ready for 5.13.0 so will release sometime after)

@astrobot-houston
Copy link
Contributor

astrobot-houston commented Jul 31, 2025

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

File Note
en/reference/experimental-flags/csp.mdx Source changed, localizations will be marked as outdated.
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

Copy link

netlify bot commented Jul 31, 2025

Deploy Preview for astro-docs-2 ready!

Name Link
🔨 Latest commit ff7a8a2
🔍 Latest deploy log https://app.netlify.com/projects/astro-docs-2/deploys/689c4b8d6d5fc0000809876d
😎 Deploy Preview https://deploy-preview-12103--astro-docs-2.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
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

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

Hey Florian! Just a couple of quick initial questions here to start!

<p>

**Type:** `string[]`<br />
**Default:** `[]`<br />
Copy link
Member

Choose a reason for hiding this comment

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

Didn't we run into a similar tricky situation documenting something not too long ago where adding any value overrides (and removes) the default that needs to be added back in? 😅 What was that and how did we handle that?

I think what feels off here is that if you do nothing, by default you get the same result as if you added this property with 'self', right? So it's kind of like the default value is 'self' and not nothing?

Copy link
Member Author

Choose a reason for hiding this comment

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

Indeed! FYI I just copied the other properties so they would also need to be updated

Suggested change
**Default:** `[]`<br />
**Default:** `["'self'"]`<br />

<meta
http-equiv="content-security-policy"
content="
font-src https://fonts.cdn.example.com;
Copy link
Member

Choose a reason for hiding this comment

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

Is this the same situation where doing this overrides and removes 'self'? If so, feels like that should also be mentioned, since it will remove the default?

Copy link
Member Author

Choose a reason for hiding this comment

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

In this case, it's merged with the config so we could show 'self' if we wanted. Maybe @ematipico has an opinion on this!

Copy link
Member

Choose a reason for hiding this comment

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

OK, so if this merges that's probably easier to document! We would just make sure that we describe it as "additive"

@sarah11918 sarah11918 added add new content Document something that is not in docs. May require testing, confirmation, or affect other pages. merge-on-release Don't merge this before the feature is released! (MQ=approved but WAIT for feature release!) labels Jul 31, 2025
@sarah11918 sarah11918 added this to the 5.13.0 milestone Aug 1, 2025
@sarah11918 sarah11918 added minor-release For the next minor release; in the milestone, "merge queue" when approved by Sarah! and removed minor-release For the next minor release; in the milestone, "merge queue" when approved by Sarah! labels Aug 5, 2025
@sarah11918 sarah11918 removed this from the 5.13.0 milestone Aug 8, 2025
@florian-lefebvre florian-lefebvre marked this pull request as draft August 13, 2025 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
add new content Document something that is not in docs. May require testing, confirmation, or affect other pages. merge-on-release Don't merge this before the feature is released! (MQ=approved but WAIT for feature release!)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants