Skip to content

fix(playground): align Night Owl theme with website Prism rendering#26

Open
taiman724 wants to merge 1 commit into
ProjectEvergreen:mainfrom
taiman724:bounty-23-align-night-owl
Open

fix(playground): align Night Owl theme with website Prism rendering#26
taiman724 wants to merge 1 commit into
ProjectEvergreen:mainfrom
taiman724:bounty-23-align-night-owl

Conversation

@taiman724
Copy link
Copy Markdown

概要

playground (Monaco Editor) と wcc.dev website (Prism) の Night Owl 表示を揃えるため、src/scripts/repl-init.ts で読み込んでいる monaco-themes/themes/Night Owl.json の上に 2 種類の token-rule オーバーライド を追加しました。

種別 Prism Night Owl (現状の website) monaco-themes Night Owl (現状の playground) 本PR後
.token.comment / コメント font-style: italic upright (italic 無し) italic を付与
.token.string / JS文字列 #addb67(緑、全 string 一律) string.quoted.* のみ #ecc48d(peach) #addb67 に統一

Monaco の token rules は順序評価で後勝ちなので、nightOwlTheme.rules の末尾に追記する形にしました。差分は src/scripts/repl-init.ts のみ・+18 行 / -0 行で済んでいます。

実装内容は Prism Night Owl CSS の以下と整合:

```css
.token.comment, .token.prolog, .token.cdata {
color: rgb(99, 119, 119); /* = #637777 */
font-style: italic;
}

.token.string, .token.url, .token.entity, ... {
color: rgb(173, 219, 103); /* = #addb67 */
}
```

動作確認

  1. `npm ci`
  2. `npm run lint` → 0 warnings / 0 errors
  3. `npm run check` (tsgo) → エラー無し
  4. `npx oxfmt --check src/scripts/repl-init.ts` → `All matched files use the correct format`
  5. `npm run dev` で `http://localhost:1984/\` を開き、デフォルトコードスニペットを表示
  6. 同じ Footer コンポーネントのコードを表示している wcc.dev のトップページ のコードブロック (Prism) と並べて比較し、文字列 (`'open'`、`'wcc-footer'`、`'template'` など) が 両者とも緑 (`#addb67`) で render されること、コメントが両者とも italic で render されることを目視で確認

リポ全体には pre-existing な `oxfmt --check` 警告 (21 files) がありますが、本 PR の変更範囲外なので別 PR の方が無難と判断し触っていません。

Closes #23

Add token-rule overrides on top of monaco-themes' Night Owl so the
playground's Monaco editor matches the Prism Night Owl theme used on
the wcc.dev website:

- comment / comment.line.double-slash: render in italic to match
  Prism's '.token.comment { font-style: italic }'
- string.quoted / string.quoted.double / string.quoted.single:
  use #addb67 (the green Prism uses for all .token.string) instead of
  monaco-themes' #ecc48d peach, so JS string literals look the same in
  both renderings

Verified locally by running 'npm run dev' and visually comparing the
playground at http://localhost:1984 with the code samples on
https://wcc.dev/.

Closes ProjectEvergreen#23
@netlify
Copy link
Copy Markdown

netlify Bot commented May 12, 2026

Deploy Preview for merry-croissant-ba6f9d ready!

Name Link
🔨 Latest commit ee2b9fc
🔍 Latest deploy log https://app.netlify.com/projects/merry-croissant-ba6f9d/deploys/6a0287bc21d4230008ae4ded
😎 Deploy Preview https://deploy-preview-26--merry-croissant-ba6f9d.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

align Night Owl theming between website (Prism) and playground (Monaco)

1 participant