Skip to content

Conversation

AmeroHan
Copy link
Contributor

@AmeroHan AmeroHan commented Oct 15, 2025

It is possible for a viewport to have a non-integer width when the user's system/browser scales.

Image

I removed some of the screnn and. That is because in CSS Conditional Rules Module Level 3, the not keyword can't be used to negate an individual media feature expression, only an entire media query, which affects Chrome < 104, Safari < 16.4. I believe the removal won't cause an issue. I don't think there is any reason that these styles should not be applied to printer views.

Update: Fine, I've noticed that almost all files are imported inside a huge @media screen { } in resources/skins.citizen.styles/skin.less. I have no word to say...

Update 2: I switched to another solution, which is the same as Bootstrap's. It will have no compatibility issues. Another day, I will submit the changes to the upstream MediaWiki source code, or you can submit them for me, as I don't have a developer account for now.

@coderabbitai
Copy link

coderabbitai bot commented Oct 15, 2025

Walkthrough

Introduced three new LESS variables in resources/mediawiki.less/mediawiki.skin.variables.less for max-width breakpoints (mobile, tablet, desktop), defined as corresponding min-width minus 0.02px, and added comments explaining the min/max prefix workaround and fractional viewport handling.

Changes

Cohort / File(s) Summary of modifications
Skin variables (LESS)
resources/mediawiki.less/mediawiki.skin.variables.less
Added three max-width breakpoint variables computed as min-width minus 0.02px; appended comments documenting rationale for min-/max- prefixes and fractional viewport widths.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

I twitch my whiskers at pixels so fine,
Nibbling widths by 0.02—divine!
Mobile to desktop, snug as a burrow,
Breakpoints hop true, no rounding sorrow.
In LESS we nest, with comments neat—
A tidy warren for every sheet. 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The pull request title "fix(core): 🐛 style issues when calc(breakpoint -1px) < viewport_width < breakpoint" is directly related to the changeset's purpose. The raw summary confirms that the PR adds LESS variables to address style issues occurring when a viewport has a non-integer width in a specific range, which matches the title's description of the problem being fixed. The title is specific, clear, and communicates the main objective without being vague or misleading, even though it focuses on the problem rather than the implementation details (adding new LESS variables with 0.02px breakpoint adjustments).
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
resources/skins.citizen.styles/common/features.less (1)

103-164: Autohide navigation breakpoint inversion: OK

Consider centralizing a LESS variable/mixin for the “non‑desktop” query to keep usage consistent across files.

resources/skins.citizen.styles/components/Pagetools.less (1)

156-192: Behavior change: now applies to print as well. Verify no print regressions.

Using @media not ( min-width: @min-width-breakpoint-desktop ) without a media type broadens scope beyond screen. Check print output for:

  • Fixed .page-actions bar, card positioning, shadows/borders.

Option (future): consider MQ range syntax @media (width < @min-width-breakpoint-desktop) to avoid negation while keeping intent.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0e27a83 and 4009364.

📒 Files selected for processing (22)
  • resources/skins.citizen.commandPalette/components/App.vue (1 hunks)
  • resources/skins.citizen.preferences/skins.citizen.preferences.less (1 hunks)
  • resources/skins.citizen.styles/common/common.less (1 hunks)
  • resources/skins.citizen.styles/common/features.less (1 hunks)
  • resources/skins.citizen.styles/components/Dropdown.less (2 hunks)
  • resources/skins.citizen.styles/components/Footer.less (3 hunks)
  • resources/skins.citizen.styles/components/PageSidebar.less (1 hunks)
  • resources/skins.citizen.styles/components/Pagetools.less (1 hunks)
  • resources/skins.citizen.styles/components/Search.less (1 hunks)
  • resources/skins.citizen.styles/components/StickyHeader.less (1 hunks)
  • resources/skins.citizen.styles/components/TableOfContents.less (1 hunks)
  • resources/skins.citizen.styles/tokens-citizen.less (1 hunks)
  • skinStyles/extensions/Echo/ext.echo.ui.less (1 hunks)
  • skinStyles/extensions/MediaSearch/mediasearch.styles.less (2 hunks)
  • skinStyles/extensions/MultimediaViewer/mmv.less (3 hunks)
  • skinStyles/extensions/Tabber/ext.Tabber.less (1 hunks)
  • skinStyles/extensions/UniversalLanguageSelector/ext.uls.common.less (1 hunks)
  • skinStyles/extensions/UploadWizard/ext.uploadWizard.less (1 hunks)
  • skinStyles/extensions/VisualEditor/ext.visualEditor.core.less (2 hunks)
  • skinStyles/mediawiki/debug/mediawiki.debug.less (1 hunks)
  • skinStyles/mediawiki/special/mediawiki.special.changeslist.legend.less (1 hunks)
  • skinStyles/mediawiki/special/mediawiki.special.search.styles.less (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (9)
  • resources/skins.citizen.commandPalette/components/App.vue
  • resources/skins.citizen.styles/tokens-citizen.less
  • skinStyles/mediawiki/special/mediawiki.special.search.styles.less
  • resources/skins.citizen.styles/components/StickyHeader.less
  • skinStyles/extensions/MediaSearch/mediasearch.styles.less
  • resources/skins.citizen.styles/components/TableOfContents.less
  • skinStyles/extensions/Tabber/ext.Tabber.less
  • resources/skins.citizen.styles/components/Dropdown.less
  • resources/skins.citizen.styles/components/PageSidebar.less
🔇 Additional comments (16)
skinStyles/extensions/UniversalLanguageSelector/ext.uls.common.less (1)

60-67: Breakpoint inversion looks good; confirm print impact

Change fixes sub-px gap and older MQ parsing issues. Since this now targets all media (not just screen), please confirm no adverse effects in print.

skinStyles/extensions/VisualEditor/ext.visualEditor.core.less (2)

182-196: Save button small-viewport rule: OK

Inversion removes the fractional gap and aligns with the PR pattern.


199-207: Small-viewport toolbar pruning: OK

Matches the new non-desktop breakpoint; no logic changes.

Please sanity‑check on widths around the desktop threshold to ensure no flicker with the desktop toolbar rules above.

skinStyles/mediawiki/special/mediawiki.special.changeslist.legend.less (1)

38-41: OK to invert breakpoint; watch print

Good inversion. Since this now applies beyond screen, verify legend layout in print if relevant.

skinStyles/extensions/UploadWizard/ext.uploadWizard.less (1)

56-58: Confirm token parity (mobile vs tablet)

This relies on @min-width-breakpoint-tablet == @max-width-breakpoint-mobile + 1px to keep behavior identical. Please confirm the variables match that contract.

skinStyles/extensions/Echo/ext.echo.ui.less (1)

117-137: Backdrop breakpoint inversion: OK

Matches PR intent and avoids the sub‑px gap. Coexists with the 720px rule above.

Please smoke‑test with browser zoom (e.g., 90%/110%) around the desktop threshold.

skinStyles/extensions/MultimediaViewer/mmv.less (3)

91-95: Stripe button small-viewport rule: OK


267-270: Metadata layout on expand: OK


277-279: Links column width rule: OK

skinStyles/mediawiki/debug/mediawiki.debug.less (1)

157-159: Debug toolbar spacing inversion: OK

resources/skins.citizen.preferences/skins.citizen.preferences.less (1)

116-118: Scope broadened beyond screen—confirm desired in print.

Autohide navigation pref block will now be active for non-desktop widths in print too. Sanity-check print layout.

resources/skins.citizen.styles/common/common.less (1)

168-174: Good fix for fractional breakpoint gaps.

Inversion avoids the off-by-1/epsilon issue. Fallback overflow-x: hidden + clip ordering is fine. Please spot-check print to ensure clipping doesn’t hide content unintentionally.

resources/skins.citizen.styles/components/Search.less (1)

169-182: Mobile-search rules now active in print—verify.

Width/transition tweaks will apply outside desktop in print too. Confirm the search overlay/card doesn’t affect printed pages.

resources/skins.citizen.styles/components/Footer.less (3)

12-17: Footer spacing rule now affects print—verify.

The extra bottom margin tied to header size may be unnecessary in print. Confirm no excess whitespace.


32-35: LGTM on breakpoint inversion.

not ( min-width: @min-width-breakpoint-tablet ) matches intended “below tablet” behavior without 1px gaps.


89-91: Negative inline margins below desktop—check print.

This now applies for print as well; ensure it doesn’t cause content to bleed outside the printable area.

@alistair3149
Copy link
Member

Bug report filed upstream, meanwhile I will merge the fix in shortly.

@alistair3149 alistair3149 merged commit 7ae0f48 into StarCitizenTools:main Oct 15, 2025
5 checks passed
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.

2 participants