fix(react): style verbatim via CSS, not an inline gray code block - #34
Merged
Conversation
The verbatim component hardcoded a gray (#f5f5f5) code-block look, so every consumer got it regardless of page background and could only override it with !important. Move the styling into latex2js.css as a plain, page-coloured default (transparent, no padding/rounding) — matching the original sites — which consumers can override with a normal rule.
pnpm build copies packages/latex2js/latex2js.css into bundle/latex2js.css; the verbatim CSS landed in the source but the committed bundle stayed stale, failing the 'Shipped bundle is up to date' check.
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.
Moves the verbatim styling out of the React component's inline style and into
latex2js.css.Problem
latex2react's verbatim component hardcodedbackgroundColor: #f5f5f5+ 10px padding + 4px radius, so every consumer got a gray code block regardless of page background, and sites could only override it with!important(the latex2js.com/mathapedia.com sites both had to do exactly that).Change
verbatim.tsxrenders just<pre className="verbatim">— no inline style.latex2js.css(source in@mathapedia/css+ shipped copy) now defines the default:This is the last inline style in the react components; nicebox/enumerate/math were already converted to
lines+ CSS.