René's URL Explorer Experiment


Title: Code block theming breaks after build in Astro + Starlight setup · Issue #352 · expressive-code/expressive-code · GitHub

Open Graph Title: Code block theming breaks after build in Astro + Starlight setup · Issue #352 · expressive-code/expressive-code

X Title: Code block theming breaks after build in Astro + Starlight setup · Issue #352 · expressive-code/expressive-code

Description: Hi everyone, we’re using Expressive Code with Astro and Starlight, and we’ve encountered an issue where code block theming works in development, but breaks after building the project. We have a working ec.config.mjs in the root of our As...

Open Graph Description: Hi everyone, we’re using Expressive Code with Astro and Starlight, and we’ve encountered an issue where code block theming works in development, but breaks after building the project. We have a wor...

X Description: Hi everyone, we’re using Expressive Code with Astro and Starlight, and we’ve encountered an issue where code block theming works in development, but breaks after building the project. We have a wor...

Opengraph URL: https://github.com/expressive-code/expressive-code/issues/352

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Code block theming breaks after build in Astro + Starlight setup","articleBody":"Hi everyone,\n\nwe’re using Expressive Code with Astro and Starlight, and we’ve encountered an issue where code block theming works in development, but breaks after building the project.\n \nWe have a working ec.config.mjs in the root of our Astro project, and in dev mode, everything works as expected, both styleOverrides and custom themes are correctly applied.\n \nHowever, after running astro build, we noticed the following behavior:\n\n**Markdown code blocks (e.g., ```js):**\n- Reference a valid CSS file, such as ec.l7s1q.css.\n- Apply both styleOverrides and custom themes correctly.\n \n**`\u003cCode /\u003e` component:**\n- References a different, non-existent CSS file, e.g., ec.4551.css. \n- This causes a 404 error in the browser.\n- As a result, no theme styles are applied, although the base styleOverrides still take effect.\n\n**Additional notes**\n- Our ec.config.mjs is clearly being picked up — the styleOverrides apply consistently to both markdown code blocks and `\u003cCode /\u003e`.\n- The issue appears to be isolated to theme configuration not applying to `\u003cCode /\u003e` after build.\n- Setting emitExternalStylesheet: false does not resolve the issue — the `\u003cCode /\u003e` component still attempts to load the missing CSS file.\n\n**DevTools inspection confirms:**\n- Markdown blocks use the correct ec.l7s1q.css.\n- `\u003cCode /\u003e` tries to load ec.4551.css, which isn’t present in the output.\n\n \n**Setup**\nAstro: v5.11.0\nStarlight: v0.34.4\nNode: v22.15.0\nIntegration through Starlight\nCustom ec.config.mjs in project root\n\nAnyone facing similar problems?\n\n**ec.config.mjs (snippet):**\n````\nexport default {\n  themes: ['github-light', 'github-dark', 'github-dark-high-contrast'],\n  themeCssSelector: (theme) =\u003e {\n    switch (theme.name) {\n      case 'github-light':\n        return '[data-theme=\"light\"]';\n      case 'github-dark':\n        return '[data-theme=\"dark\"]';\n      case 'github-dark-high-contrast':\n        return '[data-theme=\"highContrast\"]';\n      default:\n        return 'html';\n    }\n  },\n  styleOverrides: {\n    // ...\n  },\n};\n\n","author":{"url":"https://github.com/anouschkach","@type":"Person","name":"anouschkach"},"datePublished":"2025-07-17T20:07:25.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/352/expressive-code/issues/352"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:9d96f329-abc0-2046-f13b-1cf82d5e794b
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE37A:32D7CA:16A991:1EBB03:6A568941
html-safe-nonce02cbca84a75bb8fc25b8078a843953eafa5a2bbd646bd109430ef0183db8484f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMzdBOjMyRDdDQToxNkE5OTE6MUVCQjAzOjZBNTY4OTQxIiwidmlzaXRvcl9pZCI6Ijc0NDgxMjY4Nzk2OTYzMjQ5MjkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacef8b16d1821631408ac0265f8e00b725ebb0ef809d6ca70ea898152c992b3048
hovercard-subject-tagissue:3240772113
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/expressive-code/expressive-code/352/issue_layout
twitter:imagehttps://opengraph.githubassets.com/b1a5e93b50bec6961ab8e92df49911747b606812ecf77a7d090ee194976049b8/expressive-code/expressive-code/issues/352
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/b1a5e93b50bec6961ab8e92df49911747b606812ecf77a7d090ee194976049b8/expressive-code/expressive-code/issues/352
og:image:altHi everyone, we’re using Expressive Code with Astro and Starlight, and we’ve encountered an issue where code block theming works in development, but breaks after building the project. We have a wor...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameanouschkach
hostnamegithub.com
expected-hostnamegithub.com
None8f21be8503ba8fe6154df415b855c03af52eae3f285bd6ae1fef041dc053da38
turbo-cache-controlno-preview
go-importgithub.com/expressive-code/expressive-code git https://github.com/expressive-code/expressive-code.git
octolytics-dimension-user_id124694388
octolytics-dimension-user_loginexpressive-code
octolytics-dimension-repository_id533081040
octolytics-dimension-repository_nwoexpressive-code/expressive-code
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id533081040
octolytics-dimension-repository_network_root_nwoexpressive-code/expressive-code
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release78af172a48a2056810bb627ffa684003e4f9a5ca
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/expressive-code/expressive-code/issues/352#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fexpressive-code%2Fexpressive-code%2Fissues%2F352
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fexpressive-code%2Fexpressive-code%2Fissues%2F352
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=expressive-code%2Fexpressive-code
Reloadhttps://github.com/expressive-code/expressive-code/issues/352
Reloadhttps://github.com/expressive-code/expressive-code/issues/352
Reloadhttps://github.com/expressive-code/expressive-code/issues/352
Please reload this pagehttps://github.com/expressive-code/expressive-code/issues/352
expressive-code https://github.com/expressive-code
expressive-codehttps://github.com/expressive-code/expressive-code
Notifications https://github.com/login?return_to=%2Fexpressive-code%2Fexpressive-code
Fork 44 https://github.com/login?return_to=%2Fexpressive-code%2Fexpressive-code
Star 945 https://github.com/login?return_to=%2Fexpressive-code%2Fexpressive-code
Code https://github.com/expressive-code/expressive-code
Issues 10 https://github.com/expressive-code/expressive-code/issues
Pull requests 8 https://github.com/expressive-code/expressive-code/pulls
Discussions https://github.com/expressive-code/expressive-code/discussions
Actions https://github.com/expressive-code/expressive-code/actions
Security and quality 0 https://github.com/expressive-code/expressive-code/security
Insights https://github.com/expressive-code/expressive-code/pulse
Code https://github.com/expressive-code/expressive-code
Issues https://github.com/expressive-code/expressive-code/issues
Pull requests https://github.com/expressive-code/expressive-code/pulls
Discussions https://github.com/expressive-code/expressive-code/discussions
Actions https://github.com/expressive-code/expressive-code/actions
Security and quality https://github.com/expressive-code/expressive-code/security
Insights https://github.com/expressive-code/expressive-code/pulse
Code block theming breaks after build in Astro + Starlight setuphttps://github.com/expressive-code/expressive-code/issues/352#top
bugSomething isn't workinghttps://github.com/expressive-code/expressive-code/issues?q=state%3Aopen%20label%3A%22bug%22
https://github.com/anouschkach
anouschkachhttps://github.com/anouschkach
on Jul 17, 2025https://github.com/expressive-code/expressive-code/issues/352#issue-3240772113
bugSomething isn't workinghttps://github.com/expressive-code/expressive-code/issues?q=state%3Aopen%20label%3A%22bug%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.