[docs-infra] Extend Syntax Highlighting#4658
Conversation
commit: |
✅ Deploy Preview for base-ui ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
Bundle size
PerformanceTotal duration: 1,487.46 ms 🔺+130.23 ms(+9.6%) | Renders: 53 (+0) | Paint: 2,287.76 ms 🔺+185.68 ms(+8.8%)
...and 7 more. View full report Check out the code infra dashboard for more information about this PR. |
✅ Deploy Preview for base-ui ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
| /* Target CSS property names in CSS code blocks | ||
| Property names are .pl-c1 elements that are followed by a text node containing ':' | ||
| This distinguishes them from function names like 'var' which are followed by '(' */ |
There was a problem hiding this comment.
This is now handled by:
--color-docs-infra-syntax-css-property: var(--color-foreground);| --color-docs-infra-syntax-this: var(--color-red); | ||
| --color-docs-infra-syntax-builtin-type: var(--color-blue); | ||
| --color-docs-infra-syntax-jsx: var(--color-blue); | ||
| --color-docs-infra-syntax-html-tag: var(--color-green); |
| --color-docs-infra-syntax-attr-key: var(--color-violet); | ||
| --color-docs-infra-syntax-attr-value: var(--color-navy); | ||
| --color-docs-infra-syntax-attr-equals: var(--color-red); |
There was a problem hiding this comment.
Where are these ones used?
There was a problem hiding this comment.
With <Combobox.Positioner align="start" sideOffset={4}>
align and sideOffset are --color-docs-infra-syntax-attr-key
The = are --color-docs-infra-syntax-attr-equals
And "start" is --color-docs-infra-syntax-attr-value (it only applies to literal string values)
<<span class="pl-c1 di-jsx">Combobox.Positioner</span> <span class="pl-e di-ak">align</span><span class="pl-k di-ae">=</span><span class="pl-s di-av"><span class="pl-pds">"</span>start<span class="pl-pds">"</span></span> <span class="pl-e di-ak">sideOffset</span><span class="pl-k di-ae">=</span><span class="pl-pse">{</span><span class="pl-c1 di-num">4</span><span class="pl-pse">}</span>>I just set them to the same color they were already being displayed as, but feel free to customize them.


Note
Upstream PR: mui/mui-public#1307 (released in
v0.9)Adds additional classes to target when highlighting code snippets.
Preview Deploy
Before:
After: