Skip to content

Clean up deprecated CSS and fix silent CSS bugs in frontend#2012

Open
paskal wants to merge 2 commits intomasterfrom
fix/frontend-css-cleanup
Open

Clean up deprecated CSS and fix silent CSS bugs in frontend#2012
paskal wants to merge 2 commits intomasterfrom
fix/frontend-css-cleanup

Conversation

@paskal
Copy link
Collaborator

@paskal paskal commented Feb 23, 2026

Summary

  • Remove deprecated HTML attributes from iframe creation (frameborder, allowtransparency, scrolling, horizontalscrolling, verticalscrolling)—all already handled by CSS
  • Replace non-standard allowtransparency with spec-correct body { background: transparent }
  • Drop dead -moz-touch-enabled media query prefix (removed in Firefox 58, 2018); pointer: coarse was already the second condition in every query
  • Fix missing comma in transition shorthand (comment-votes.module.css)—colour transitions on vote buttons were silently broken
  • Fix transfrom typo in icon-button.module.css—hover scale animation jumped instead of easing
  • Fix double rgb(rgb(var(…))) in auth.module.css.title colour fell back to inherited instead of --secondary-text-color
  • Replace deprecated clip: rect() with clip-path: inset(50%)
  • Replace deprecated word-wrap with overflow-wrap
  • Remove redundant IE11-era CSS variable fallbacks from .preloader

colorScheme: 'none' in create-iframe.ts is intentionally left unchanged; tracked by #1430.

@paskal paskal requested a review from umputun as a code owner February 23, 2026 18:41
Three separate cleanups:

1. remove deprecated HTML attributes from iframe creation (create-iframe.ts)
   - frameborder="0": deprecated since HTML5; border is already set to none via CSS
   - allowtransparency="true": non-standard Microsoft attribute never in any spec;
     transparency is handled by body { background: transparent } in CSS instead
   - scrolling="no": deprecated since HTML5; overflow is already hidden via CSS
   - horizontalscrolling/verticalscrolling: non-standard IE-era attributes with
     no effect in modern browsers; remove without replacement

2. replace allowtransparency with explicit CSS (global.css)
   - add background: transparent to body; this is the spec-correct way to make
     an iframe document transparent, as documented by MDN

3. drop -moz-touch-enabled media query prefix (5 comment CSS files)
   - -moz-touch-enabled was a Firefox-only non-standard media feature removed
     in Firefox 58 (2018); pointer: coarse is the standard equivalent and was
     already present as the second condition in every query, so removing the
     dead -moz prefix reduces the media query to just (pointer: coarse)

note: colorScheme: 'none' in create-iframe.ts is intentionally left unchanged;
it is tracked by #1430 and requires a broader color-scheme implementation
Bugs fixed:

- comment-votes.module.css: add missing comma between transition values;
  without it the shorthand was invalid and colour transitions on vote
  buttons were silently ignored

- icon-button.module.css: fix "transfrom" typo (should be "transform");
  the misspelling made the transition declaration a no-op, so the hover
  scale animation jumped instantly instead of easing

- auth.module.css: remove doubly-nested rgb(rgb(var(…))) call; the outer
  rgb() rejected the inner rgb() result, so the .title element's colour
  fell back to inherited instead of the intended --secondary-text-color

Deprecated properties replaced:

- comment-form__markdown-toolbar.css: replace deprecated clip: rect()
  with clip-path: inset(50%); clip was deprecated in CSS Masking Level 1

- raw-content.css: replace word-wrap with overflow-wrap; word-wrap was
  renamed in CSS Text Level 3, all current browsers support overflow-wrap

- global.css: remove redundant literal-colour fallback lines before
  var() declarations in .preloader and .preloader_view_iframe; the var()
  calls already have inline fallback values (e.g. var(--color6, #fff)),
  making the preceding duplicate property and its stylelint-disable
  comment unnecessary since IE11 EOL
@paskal paskal force-pushed the fix/frontend-css-cleanup branch from 2e083c7 to b76be5d Compare February 23, 2026 18:42
@github-actions
Copy link

github-actions bot commented Feb 23, 2026

size-limit report 📦

Path Size
public/embed.mjs 2.02 KB (-2.09% 🔽)
public/remark.mjs 73.82 KB (0%)
public/remark.css 8.17 KB (-0.61% 🔽)
public/last-comments.mjs 36.19 KB (-0.01% 🔽)
public/last-comments.css 3.73 KB (-0.58% 🔽)
public/deleteme.mjs 12.42 KB (0%)
public/counter.mjs 747 B (0%)

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR modernizes the frontend CSS and HTML by removing deprecated properties, fixing silent CSS bugs, and replacing obsolete browser-specific prefixes with standard equivalents.

Changes:

  • Fixed three silent CSS bugs: missing comma in transition shorthand (broke color transitions), typo in transform property (broke hover animations), and double rgb() function (broke color rendering)
  • Removed deprecated HTML iframe attributes and replaced with CSS equivalents
  • Updated deprecated CSS properties (clip, word-wrap) to modern standards (clip-path, overflow-wrap)
  • Removed obsolete -moz-touch-enabled media query prefix (Firefox 58+) and IE11-era CSS variable fallbacks
  • Added background: transparent to body to replace non-standard allowtransparency iframe attribute

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.

Show a summary per file
File Description
frontend/apps/remark42/templates/demo.ejs Replaced deprecated frameborder attribute with inline border:none style
frontend/apps/remark42/app/utils/create-iframe.ts Removed deprecated iframe HTML attributes (frameborder, allowtransparency, scrolling, horizontalscrolling, verticalscrolling)
frontend/apps/remark42/app/styles/global.css Added background: transparent to body element and removed IE11 CSS variable fallbacks
frontend/apps/remark42/app/components/icon-button/icon-button.module.css Fixed typo: transfromtransform (fixes hover scale animation)
frontend/apps/remark42/app/components/comment/raw-content.css Updated deprecated word-wrap to standard overflow-wrap
frontend/apps/remark42/app/components/comment/comment.css Removed obsolete -moz-touch-enabled media query prefix
frontend/apps/remark42/app/components/comment/comment-votes.module.css Fixed transition syntax: added missing comma between properties
frontend/apps/remark42/app/components/comment/_theme/_light/comment_theme_light.css Removed obsolete -moz-touch-enabled media query prefix (2 occurrences)
frontend/apps/remark42/app/components/comment/_theme/_dark/comment_theme_dark.css Removed obsolete -moz-touch-enabled media query prefix (2 occurrences)
frontend/apps/remark42/app/components/comment/_replying/comment_replying.css Removed obsolete -moz-touch-enabled media query prefix
frontend/apps/remark42/app/components/comment/_editing/comment_editing.css Removed obsolete -moz-touch-enabled media query prefix
frontend/apps/remark42/app/components/comment-form/__markdown-toolbar/comment-form__markdown-toolbar.css Updated deprecated clip: rect() to standard clip-path: inset(50%)
frontend/apps/remark42/app/components/auth/auth.module.css Fixed double rgb() wrapper: rgb(rgb(var(...)))rgb(var(...))

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link

codecov bot commented Feb 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.17%. Comparing base (b38d91c) to head (b76be5d).
⚠️ Report is 7 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #2012    +/-   ##
========================================
  Coverage   62.17%   62.17%            
========================================
  Files         132      132            
  Lines        3035     3035            
  Branches      769      769            
========================================
  Hits         1887     1887            
+ Misses       1144     1034   -110     
- Partials        4      114   +110     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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