pages/assets
Suraj Khamkar da32034525
Fix issue causing no color inversion when rendering equations (#2956)
## Problem Description

When dark mode is enabled, inline math expressions rendered using
`$...$` in distill-style blog posts are displayed in black text. This
makes them difficult to read against the dark background. The issue
occurs because the default styles for MathJax-rendered content do not
account for dark mode and set the text color to black.

## Proposed Solution

This PR updates the MathJax setup to dynamically apply inline styles to
ensure the text color of MathJax-rendered content inherits the parent
container’s color. Specifically:
- Added a custom action in the _MathJax.options.renderActions_ section
to inject a CSS rule that sets _.mjx-container_ to inherit its color
from its parent element.
- Ensures that inline math expressions render correctly in both light
and dark modes without explicitly setting a fixed color.

## Changes Made
Modified the _mathjax-setup.js_ file to include:
- Custom inline styles injected via JavaScript for _.mjx-container_
elements.
- Explicit handling of _inlineMath_ delimiters to ensure consistency in
rendering.

## Testing and Validation
- Tested the fix in both light and dark modes to confirm that inline
math expressions render in the correct color.
- Verified that the changes do not introduce regressions in light mode
or affect block math expressions rendered using `$$...$$`.

## Impact
- Improves readability of inline math expressions in dark mode.
- Provides a consistent user experience for distill-style blog posts
across light and dark themes.
- Resolves #2915

Co-authored-by: Suraj Khamkar <surajk@atlanticpkg.com>
2025-01-15 23:11:44 -03:00
..
audio Audio and Video support (#1367) 2023-05-15 12:31:27 -03:00
bibliography Issue 183 (#192) 2021-03-29 11:49:42 -04:00
css Moved socials config to _data/socials.yml (#2885) 2024-12-12 12:44:43 -03:00
fonts Moved socials config to _data/socials.yml (#2885) 2024-12-12 12:44:43 -03:00
html Add option for local HTML files (#2245) 2024-03-04 14:04:52 -03:00
img Added example of site with css and js not loaded 2024-07-21 17:03:58 -03:00
js Fix issue causing no color inversion when rendering equations (#2956) 2025-01-15 23:11:44 -03:00
json Update work.liquid to show the location of work experience under cv … (#2349) 2024-04-17 15:17:43 -03:00
jupyter Added support for jupyter notebooks #417 (#1511) 2023-07-05 12:43:59 -03:00
pdf Include link and pdf in bib 2019-08-06 14:02:16 -04:00
plotly Add interactive plotly example to distill post (#1027) 2022-12-20 18:09:32 -05:00
video Added video tutorial to install instructions (#2653) 2024-08-22 13:49:05 -03:00
webfonts Update Font Awesome and Tabler Icons (#2884) 2024-12-11 15:19:38 -03:00