fix(css): restore Shiki color mapping for CDS code blocks (#1657) - #1666
Merged
Conversation
The pipeline fix (#1661) got correct Shiki markup live, but tokens rendered uncoloured: highlight-cds.ts uses defaultColor:false, so each span carries only --shiki-light/--shiki-dark CSS variables and no `color`. The rules that paint those variables were dropped in a9d9411 (static sap-fundamental.css cleanup), so there was nothing to colour the spans. Restore the .shiki color mapping in the SOURCE sap-fundamental.src.css (light + html.dark/[data-theme=dark]) and rebuild sap-fundamental.css. CSS-only — ships with a normal deploy; no content rebuild needed (Shiki HTML already in HANA). Verified computed token colours resolve in both themes (light #D73A49 keyword / dark #F97583; punctuation #24292E / #E1E4E8).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #1661 for #1657.
Why a second PR
#1661 fixed the pipeline — DEV now serves correct Shiki markup (298 shiki spans, 0
language-sql, the rederrbraces are gone). But the CDS blocks still render as uncoloured text.Root cause
scripts/highlight-cds.tsemits Shiki withdefaultColor: false, so each token span carries only--shiki-light/--shiki-darkCSS variables and nocolor. Painting them requires a supporting rule:That block existed in the original CDS-highlighting commit (
7b66dfba) but was removed ina9d94110("approuter local dev and content-serve improvements") when the staticsap-fundamental.csswas cleaned up. Nothing has coloured the spans since — hence "we had this working in the past."Fix
Restore the
.shikicolor mapping in the sourcehugo/assets/css/sap-fundamental.src.css(sobuild:cssbakes it into the served, fingerprinted stylesheet — the static file it originally lived in no longer exists), and rebuildsap-fundamental.css. Dark selectors cover bothhtml.darkand[data-theme="dark"](the toggle sets both in lockstep, perhead.html).Scope
CSS-only. Ships with a normal MTA deploy (approuter static) — no content rebuild needed; the Shiki HTML is already correct in HANA.
Verification
Loaded the real served Shiki markup with the new CSS in a browser and read computed token colours:
rgb(215,58,73)(#D73A49), punctuationrgb(36,41,46)(#24292E)rgb(249,117,131)(#F97583), punctuationrgb(225,228,232)(#E1E4E8)