Skip to content

refactor(styles): theme-adaptive shared code theme#8023

Open
talissoncosta wants to merge 12 commits into
mainfrom
refactor/hljs-theme-adaptive
Open

refactor(styles): theme-adaptive shared code theme#8023
talissoncosta wants to merge 12 commits into
mainfrom
refactor/hljs-theme-adaptive

Conversation

@talissoncosta

Copy link
Copy Markdown
Contributor
  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

Makes the shared highlight.js theme (_hljs.scss) theme-adaptive: code blocks follow light/dark via semantic tokens instead of always rendering dark. Shared app-wide, including the value editor.

  • Surface + syntax palette → semantic tokens (lifted from the onboarding code card)
  • .hljs--embedded for code inside a container that owns its surface; onboarding's card uses it and drops its overrides
  • CodeHelp/Highlight import Button instead of the global; adds CodeHelp stories for light/dark QA

Follow-ups: the scrollbar, header/button chrome, and value-editor input still carry dark styling.

How did you test this code?

CI visual-regression across light/dark, plus the CodeHelp stories in both themes. lint and typecheck pass.

@github-actions github-actions Bot added front-end Issue related to the React Front End Dashboard refactor labels Jul 15, 2026
@vercel

vercel Bot commented Jul 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
flagsmith-frontend-preview Ready Ready Preview, Comment Jul 16, 2026 8:35pm
flagsmith-frontend-staging Ready Ready Preview, Comment Jul 16, 2026 8:35pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Ignored Ignored Preview Jul 16, 2026 8:35pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a Storybook documentation page covering CodeHelp setup and embedded states, and fixes missing Button imports. Refactors Highlight to centralise raw HTML selection and escaping. Replaces hardcoded Highlight.js colours with design-system tokens and adds an embedded modifier. The onboarding code card now uses that modifier, while its local syntax-colour rules are removed.

Estimated code review effort: 4 (Complex) | ~45 minutes


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@talissoncosta talissoncosta marked this pull request as ready for review July 15, 2026 18:52
@talissoncosta talissoncosta requested a review from a team as a code owner July 15, 2026 18:52
@talissoncosta talissoncosta requested review from kyle-ssg and removed request for a team July 15, 2026 18:52
@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-api-test:pr-8023 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-e2e:pr-8023 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api:pr-8023 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-8023 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-8023 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-frontend:pr-8023 Finished ✅ Results

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 541e0da9-4ac1-4a1d-bfe5-aae4eb6f2199

📥 Commits

Reviewing files that changed from the base of the PR and between b51e6b7 and dba3f38.

📒 Files selected for processing (6)
  • frontend/documentation/pages/CodeHelp.stories.tsx
  • frontend/web/components/CodeHelp.tsx
  • frontend/web/components/Highlight.js
  • frontend/web/components/pages/onboarding/OnboardingConnectPanel/CodeCard.tsx
  • frontend/web/components/pages/onboarding/OnboardingConnectPanel/OnboardingConnectPanel.scss
  • frontend/web/styles/3rdParty/_hljs.scss

import Utils from 'common/utils/utils'
import Icon from './icons/Icon'
import CalloutBar from './CalloutBar'
import Button from './base/forms/Button'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Use the repository import alias for Button.

Change this to components/base/forms/Button rather than a relative import.

Proposed fix
-import Button from './base/forms/Button'
+import Button from 'components/base/forms/Button'

As per coding guidelines, frontend files must use only common/, components/, and project/ import paths and must not use relative imports.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import Button from './base/forms/Button'
import Button from 'components/base/forms/Button'

Source: Coding guidelines

@@ -1,5 +1,6 @@
import React from 'react'
import hljs from 'highlight.js'
import Button from './base/forms/Button'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Use the permitted component import path.

-import Button from './base/forms/Button'
+import Button from 'components/base/forms/Button'

As per coding guidelines, “Use only common/, components/, and project/ import paths; do not use relative imports.”

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import Button from './base/forms/Button'
import Button from 'components/base/forms/Button'

Source: Coding guidelines

Comment thread frontend/web/styles/3rdParty/_hljs.scss Outdated
@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  3 passed

Details

stats  3 tests across 3 suites
duration  40.4 seconds
commit  dba3f38
info  🔄 Run: #18321 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  5 passed

Details

stats  5 tests across 4 suites
duration  7.6 seconds
commit  dba3f38
info  🔄 Run: #18321 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  4 passed

Details

stats  4 tests across 3 suites
duration  6.8 seconds
commit  dba3f38
info  🔄 Run: #18321 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  5 passed

Details

stats  5 tests across 4 suites
duration  12.5 seconds
commit  dba3f38
info  🔄 Run: #18321 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  5 passed

Details

stats  5 tests across 3 suites
duration  42.4 seconds
commit  b1c981e
info  🔄 Run: #18322 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  5 passed

Details

stats  5 tests across 4 suites
duration  45.8 seconds
commit  b1c981e
info  🔄 Run: #18322 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  6 passed

Details

stats  6 tests across 6 suites
duration  7.6 seconds
commit  b1c981e
info  🔄 Run: #18322 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  5 passed

Details

stats  5 tests across 4 suites
duration  41.5 seconds
commit  b1c981e
info  🔄 Run: #18322 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  33.1 seconds
commit  aabba13
info  🔄 Run: #18349 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  44.9 seconds
commit  aabba13
info  🔄 Run: #18349 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

failed  1 failed

Details

stats  1 test across 1 suite
duration  12.4 seconds
commit  aabba13
info  📦 Artifacts: View test results and HTML report
🔄 Run: #18349 (attempt 1)

Failed tests

firefox › tests/onboarding-tests.pw.ts › Onboarding › New user connects via the single-page onboarding flow @oss

### Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  33.1 seconds
commit  168e086
info  🔄 Run: #18351 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  44.4 seconds
commit  168e086
info  🔄 Run: #18351 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  5 passed

Details

stats  5 tests across 5 suites
duration  32.3 seconds
commit  168e086
info  🔄 Run: #18351 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  3 passed

Details

stats  3 tests across 3 suites
duration  43.6 seconds
commit  168e086
info  🔄 Run: #18351 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  43.3 seconds
commit  a1a038c
info  🔄 Run: #18410 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  45.7 seconds
commit  a1a038c
info  🔄 Run: #18410 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  37.2 seconds
commit  a1a038c
info  🔄 Run: #18410 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  34.1 seconds
commit  a1a038c
info  🔄 Run: #18410 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  36.6 seconds
commit  ef3dd01
info  🔄 Run: #18411 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  47.2 seconds
commit  ef3dd01
info  🔄 Run: #18411 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  3 passed

Details

stats  3 tests across 3 suites
duration  32.1 seconds
commit  ef3dd01
info  🔄 Run: #18411 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  6.7 seconds
commit  ef3dd01
info  🔄 Run: #18411 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  41.1 seconds
commit  7c6e6cf
info  🔄 Run: #18412 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  45.2 seconds
commit  7c6e6cf
info  🔄 Run: #18412 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  7.2 seconds
commit  7c6e6cf
info  🔄 Run: #18412 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  6.5 seconds
commit  7c6e6cf
info  🔄 Run: #18412 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  35.2 seconds
commit  5523da5
info  🔄 Run: #18413 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  46 seconds
commit  5523da5
info  🔄 Run: #18413 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  46.1 seconds
commit  5523da5
info  🔄 Run: #18413 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  1 minute, 2 seconds
commit  5523da5
info  🔄 Run: #18413 (attempt 1)

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Visual Regression

19 screenshots compared. See report for details.
View full report

talissoncosta and others added 6 commits July 15, 2026 19:00
Convert the shared highlight.js theme from its hardcoded dark palette to
semantic tokens, so code blocks adapt to light/dark instead of always rendering
dark. Code surface -> --color-surface-subtle; syntax colours -> the
--color-text-* palette (first pass, lifted from the onboarding code card).

Spike: .hljs is shared app-wide incl. the interactive value editor, so this is
a visible change everywhere. Opened to see the real diff via CI visual
regression before committing to a designed palette.

Refs #6606

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Both were already won by the cascade: .select-language span.primary follows
.active at equal specificity, and code[contenteditable].hljs outranks .hljs. The
remaining !important beat highlight.js's own CSS / the Button / global resets.

Refs #6606

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Render CodeHelp with the real codeHelp snippets (install, init, create identity,
set traits) plus collapsed-header and embedded variants, so the shared code
block can be QA'd in light and dark (theme toggle) and across languages
(dropdown) in one place - the safety net for the #6606 theme change. Registers
window.Button in the Storybook preview, since CodeHelp uses the global Button
like Select.

Refs #6606

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Adopt the onboarding code card's restrained palette (five semantic-token
groups, unmapped tokens inherit the base) as the shared `.hljs` theme, and
add a `.hljs--embedded` modifier for code that sits in a container already
providing the surface (transparent, no border/radius, gutter-reserved
scrollbar). Onboarding's bespoke .hljs block collapses to that one class.

Refs #6606

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…the global

Both reached for a bare `window.Button` (the legacy project-components.js
pattern) rather than importing it, which meant Storybook had to fake the
global. Import Button directly so they stand alone, and drop the shim from the
Storybook preview. Also de-nests Highlight's pre-existing html ternary into a
small helper so the touched file passes lint.

Refs #6606

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (2)
frontend/web/components/Highlight.js (1)

3-3: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Use the permitted component import path.

Relative import still present; this was already flagged in a prior review round.

Proposed fix
-import Button from './base/forms/Button'
+import Button from 'components/base/forms/Button'

As per coding guidelines, "Use only common/, components/, and project/ import paths; do not use relative imports."

Source: Coding guidelines

frontend/web/styles/3rdParty/_hljs.scss (1)

86-86: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Restore stylelint blank-line-before-comment compliance.

Still failing scss/double-slash-comment-empty-line-before at all three sites from the previous round.

Proposed fix
   padding: 0.5em;
+
   // Theme-adaptive surface: light in light mode, dark in dark, via tokens.
   padding: 18px;
+
   // Unmapped tokens inherit the base colour instead of the highlight.js greys;
   border-radius: 0;
+
   // Reserve the scrollbar gutter so hover doesn't shift layout; !important

Also applies to: 183-183, 290-290

Source: Linters/SAST tools


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 80921548-b746-48c3-b290-c6e8aca8b379

📥 Commits

Reviewing files that changed from the base of the PR and between dba3f38 and b1c981e.

📒 Files selected for processing (6)
  • frontend/documentation/pages/CodeHelp.stories.tsx
  • frontend/web/components/CodeHelp.tsx
  • frontend/web/components/Highlight.js
  • frontend/web/components/pages/onboarding/OnboardingConnectPanel/CodeCard.tsx
  • frontend/web/components/pages/onboarding/OnboardingConnectPanel/OnboardingConnectPanel.scss
  • frontend/web/styles/3rdParty/_hljs.scss

Comment thread frontend/web/styles/3rdParty/_hljs.scss Outdated
Comment on lines 279 to 282
code[contenteditable='false'].hljs {
cursor: default !important;
cursor: default;
@include customScrollDark();
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Fix mixin call lint violation.

Stylelint flags @include customScrollDark(); for unexpected parentheses on an argumentless mixin call.

Proposed fix
 code[contenteditable='false'].hljs {
   cursor: default;
-  `@include` customScrollDark();
+  `@include` customScrollDark;
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
code[contenteditable='false'].hljs {
cursor: default !important;
cursor: default;
@include customScrollDark();
}
code[contenteditable='false'].hljs {
cursor: default;
`@include` customScrollDark;
}
🧰 Tools
🪛 Stylelint (17.14.0)

[error] 281-281: Unexpected parentheses in argumentless mixin "customScrollDark" call (scss/at-mixin-argumentless-call-parentheses)

(scss/at-mixin-argumentless-call-parentheses)

Source: Linters/SAST tools

@talissoncosta talissoncosta self-assigned this Jul 16, 2026
Pylon's support widget injects a global .hljs { background: var(--hljs-bg);
color: var(--hljs-text) } into the host document, overriding the code theme.
Define those vars on .hljs (and transparent on --embedded) so its rule paints
our tokens instead.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
frontend/web/styles/3rdParty/_hljs.scss (1)

297-302: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Avoid forcing the scrollbar on non-hover states

overflow-x: scroll plus the unqualified ::-webkit-scrollbar rule keeps the bar visible even when the code fits. Use overflow-x: auto, add scrollbar-gutter: stable, and limit display: block !important to the :hover selector.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 1505510c-624e-4fc5-8983-04c18188aa43

📥 Commits

Reviewing files that changed from the base of the PR and between b1c981e and aabba13.

📒 Files selected for processing (1)
  • frontend/web/styles/3rdParty/_hljs.scss

Swap the SCSS-var chrome colours (language selector, collapsible header,
code.txt input, invalid border) for semantic tokens so they follow the
theme like the code surface. Leaves the always-dark branded callout bar
and code.txt's dark fill as-is; neither maps cleanly to a token.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 6b68ee47-0847-4080-b705-f0952a5ce373

📥 Commits

Reviewing files that changed from the base of the PR and between aabba13 and 168e086.

📒 Files selected for processing (1)
  • frontend/web/styles/3rdParty/_hljs.scss

Comment on lines +146 to +150
background-color: var(--color-surface-muted);
font-family: $font-family-header;
overflow: hidden;
@include transition(all 0.2s ease-in-out);
color: $btn-code-button-color;
color: var(--color-text-default);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Restore the blank line before color.

Stylelint 17.14.0 reports declaration-empty-line-before at Line 150. Add an empty line after the transition mixin so this declaration passes lint.

Proposed fix
   `@include` transition(all 0.2s ease-in-out);
+
   color: var(--color-text-default);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
background-color: var(--color-surface-muted);
font-family: $font-family-header;
overflow: hidden;
@include transition(all 0.2s ease-in-out);
color: $btn-code-button-color;
color: var(--color-text-default);
background-color: var(--color-surface-muted);
font-family: $font-family-header;
overflow: hidden;
`@include` transition(all 0.2s ease-in-out);
color: var(--color-text-default);
🧰 Tools
🪛 Stylelint (17.14.0)

[error] 150-150: Expected empty line before declaration (declaration-empty-line-before)

(declaration-empty-line-before)

Source: Linters/SAST tools

background: transparent !important;
border: 1px solid $input-border-color;
border: 1px solid var(--color-border-default);
font-family: 'OpenSans', sans-serif;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Remove the unnecessary quotes around OpenSans.

The supplied Stylelint result reports font-family-name-quotes at Line 245. Use the unquoted family name so this file remains lint-compliant.

Proposed fix
-  font-family: 'OpenSans', sans-serif;
+  font-family: OpenSans, sans-serif;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
font-family: 'OpenSans', sans-serif;
font-family: OpenSans, sans-serif;
🧰 Tools
🪛 Stylelint (17.14.0)

[error] 245-245: Expected no quotes around "OpenSans" (font-family-name-quotes)

(font-family-name-quotes)

Source: Linters/SAST tools

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
frontend/web/styles/3rdParty/_hljs.scss (1)

115-124: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Scope the YAML token rules to $code-roots.

These shared .hljs-* selectors remain global, allowing the application palette to leak into Pylon or other Highlight.js consumers.

Proposed fix
-.yaml {
-  .hljs-bullet {
-    color: var(--color-text-default);
-  }
-  .hljs-attr {
-    color: var(--color-text-success);
-  }
-  .hljs-string {
-    color: var(--color-text-info);
+#{$code-roots} {
+  .yaml {
+    .hljs-bullet {
+      color: var(--color-text-default);
+    }
+    .hljs-attr {
+      color: var(--color-text-success);
+    }
+    .hljs-string {
+      color: var(--color-text-info);
+    }
   }
 }

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: cc26a66e-33cb-4fdd-af3b-93cea185aa00

📥 Commits

Reviewing files that changed from the base of the PR and between 168e086 and a1a038c.

📒 Files selected for processing (1)
  • frontend/web/styles/3rdParty/_hljs.scss

// shared classes to our React roots (index.html) so our theme and Pylon's
// widget stay isolated. :where keeps specificity flat, so this only limits
// reach, it does not change the cascade within our own rules.
$code-roots: ':where(#app, #toast, #modal, #modal2, #confirm)';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
rg -n -C3 'storybook-root|id=.app.|decorators' frontend/documentation .storybook 2>/dev/null

Repository: Flagsmith/flagsmith

Length of output: 11137


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n## Files\n'
git ls-files '.storybook/**' 'frontend/documentation/**' 'frontend/web/styles/3rdParty/_hljs.scss' | sed -n '1,200p'

printf '\n## Search for likely Storybook root wrappers/IDs\n'
rg -n -C2 'storybook-root|id=|createRoot|withRouter|decorators|layout:|parameters:' .storybook frontend/documentation 2>/dev/null || true

printf '\n## Relevant style file\n'
cat -n frontend/web/styles/3rdParty/_hljs.scss | sed -n '1,220p'

Repository: Flagsmith/flagsmith

Length of output: 50375


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n## .storybook files\n'
git ls-files '.storybook/**' | sed -n '1,200p'

printf '\n## Storybook-related wrappers / root IDs\n'
rg -n -C2 'storybook-root|id=|createRoot|withRouter|decorators|layout:|parameters:' .storybook frontend/documentation 2>/dev/null || true

printf '\n## _hljs.scss\n'
cat -n frontend/web/styles/3rdParty/_hljs.scss | sed -n '1,220p'

Repository: Flagsmith/flagsmith

Length of output: 50375


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '### Storybook config files\n'
git ls-files | rg '(^|/)\.storybook/|storybook|preview\.(ts|tsx|js|jsx)$|decorators?\.(ts|tsx|js|jsx)$'

printf '\n### Root IDs in documentation/storybook files\n'
rg -n -C2 "storybook-root|id=['\"](app|toast|modal2?|confirm)['\"]|<div[^>]+id=['\"](app|toast|modal2?|confirm)['\"]" frontend/documentation .storybook 2>/dev/null || true

Repository: Flagsmith/flagsmith

Length of output: 745


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '## Storybook preview config\n'
cat -n frontend/.storybook/preview.js | sed -n '1,220p'

printf '\n## Storybook docs container\n'
cat -n frontend/.storybook/DocsContainer.jsx | sed -n '1,220p'

printf '\n## Highlight.js styles\n'
cat -n frontend/web/styles/3rdParty/_hljs.scss | sed -n '1,220p'

Repository: Flagsmith/flagsmith

Length of output: 13093


Add #storybook-root to $code-roots The CodeHelp stories render in Storybook’s default canvas, not under #app, #toast, #modal, #modal2, or #confirm, so these Highlight.js rules won’t apply there.

Comment thread frontend/web/styles/3rdParty/_hljs.scss
Pylon injects global .hljs-<type> rules (reading its own --hljs-* vars) that
overrode our palette on deployed envs (e.g. .hljs-section rendered coral).
Nesting our palette under .hljs (0,2,0 beats Pylon's 0,1,0) plus a
[class*='hljs-'] catch-all makes our theme win, unmapped tokens included.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Pylon injects --hljs-{comment,keyword,section,literal,string,attr,symbol,class}
on :root and reads them in its global rules. Redefine the whole set to our
tokens within our scope so they're neutralised on our code (and it survives
Pylon marking a rule !important), alongside the palette specificity fix.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

front-end Issue related to the React Front End Dashboard refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant