fix(MarkdownRenderer): scope yfm theme to the renderer#184
Merged
Conversation
The yfm theming lived in a global `.yfm { ... }` ruleset. Since `.yfm` is
the shared root class of @diplodoc/transform, those overrides leaked onto
markdown that consumers render with their own transform setup — e.g.
`<strong>`/`<b>` inherited AIKit's accent weight (600) instead of the
transform default (700).
Expose the theme as a `yfm-theme` mixin and include it under the renderer's
namespaced block, so the overrides apply only to AIKit's MarkdownRenderer.
The base @diplodoc/transform CSS import stays global (standard styles,
identical for every consumer).
Add a StyleIsolation story and a test asserting that standalone `.yfm`
content keeps the transform default while AIKit content keeps its accent.
`docker run -it` aborts with "the input device is not a TTY" in CI and other non-interactive shells. Allocate `-t` only when a TTY is attached (`[ -t 0 ]`), keeping `-i` always. A plain string is used instead of an array because expanding an empty array under `set -u` errors on bash < 4.4 (macOS default). Also pass the command via `"$@"` (run directly) instead of `bash -c "$*"`, which collapsed arguments on spaces and dropped quoting — breaking multi-word values like `--grep "a b c"`.
Contributor
|
🚀 Prerelease version published! Install this PR version: npm i --save-dev @gravity-ui/aikit@2.5.1-beta.be39a20b3a63967ffa3f40d6c2ee75d061819c5c.0 |
|
Preview is ready. |
Contributor
|
🎭 Component Tests Report is ready. |
ananas7
approved these changes
Jun 15, 2026
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.
Problem
YFM theming lived in a global
.yfm { ... }ruleset (src/styles/yfm.scss)..yfmis the shared root class of@diplodoc/transform, so these AIKitoverrides were not scoped to AIKit at all — they applied to any
.yfmelement on the page.
For consumers who use
@diplodoc/transformdirectly and pull in AIKit'schat, AIKit's CSS (loaded after the transform base CSS) won the cascade on
their own markdown. The clearest symptom is
<strong>/<b>: AIKit remapsthem to its accent weight (
--g-text-accent-font-weight: 600), overriding thetransform default of
700on content AIKit never rendered. The same leakapplied to the whole
--yfm-color-*remap, links, code, notes, etc.What I hit while running the tests (and why the second commit exists)
Per the testing guidelines all Playwright tests must run through Docker
(
npm run playwright:docker). Running them surfaced two issues inplaywright/run-docker-command.sh, fixed in thechore(playwright): ...commit so the runner keeps working out of the box for everyone:
docker run -itrequires a TTY. In CI / non-interactive shells itaborts immediately with
the input device is not a TTY. We now allocate-tonly when a TTY is attached ([ -t 0 ]) and always keep-i.A plain string (not a bash array) holds the flag on purpose: expanding an
empty array under
set -uerrors on bash < 4.4, and macOS still shipsbash 3.2 by default — so the array variant would break local runs.
--grep "a b c"matched no tests. The runner executed the command viabash -c "$*", which joins all arguments into one space-separated stringand drops quoting, so a multi-word grep was split into separate words
("No tests found"). We now pass the command as
"$@"and run it directly,preserving argv exactly.