Skip to content

Commit c26f45e

Browse files
authored
Clean up deprecated CSS and fix silent CSS bugs in frontend (#2012)
* frontend: remove deprecated iframe attrs and non-standard CSS 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 * frontend: fix CSS bugs and replace deprecated properties 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 * move border:none from inline style to widget__comments-frame class
1 parent ba7c3ae commit c26f45e

File tree

13 files changed

+16
-24
lines changed

13 files changed

+16
-24
lines changed

frontend/apps/remark42/app/components/auth/auth.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
font-size: 12px;
3636
text-transform: uppercase;
3737
font-weight: bold;
38-
color: rgb(rgb(var(--secondary-text-color)));
38+
color: rgb(var(--secondary-text-color));
3939
text-align: center;
4040
}
4141

frontend/apps/remark42/app/components/comment-form/__markdown-toolbar/comment-form__markdown-toolbar.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
width: 1px;
99
height: 1px;
1010
overflow: hidden;
11-
clip: rect(0 0 0 0);
11+
clip-path: inset(50%);
1212
}
1313

1414
.comment-form__toolbar-item {

frontend/apps/remark42/app/components/comment/_editing/comment_editing.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
}
55

66
/* it isn't mobile first, but it's fine here */
7-
@media (-moz-touch-enabled: 1) and (max-width: 768px), (pointer: coarse) and (max-width: 768px) {
7+
@media (pointer: coarse) and (max-width: 768px) {
88
border: 8px solid;
99
padding-bottom: 0;
1010

frontend/apps/remark42/app/components/comment/_replying/comment_replying.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
z-index: 1;
55

66
/* it isn't mobile first, but it's fine here */
7-
@media (-moz-touch-enabled: 1) and (max-width: 768px), (pointer: coarse) and (max-width: 768px) {
7+
@media (pointer: coarse) and (max-width: 768px) {
88
border: 8px solid;
99

1010
& .comment__info {

frontend/apps/remark42/app/components/comment/_theme/_dark/comment_theme_dark.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
border-color: var(--color7);
7070
}
7171

72-
@media (-moz-touch-enabled: 1) and (max-width: 768px), (pointer: coarse) and (max-width: 768px) {
72+
@media (pointer: coarse) and (max-width: 768px) {
7373
border-color: var(--color7);
7474
}
7575
}
@@ -79,7 +79,7 @@
7979
border-color: var(--color7);
8080
}
8181

82-
@media (-moz-touch-enabled: 1) and (max-width: 768px), (pointer: coarse) and (max-width: 768px) {
82+
@media (pointer: coarse) and (max-width: 768px) {
8383
border-color: var(--color7);
8484
}
8585
}

frontend/apps/remark42/app/components/comment/_theme/_light/comment_theme_light.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
border-color: var(--color5);
6666
}
6767

68-
@media (-moz-touch-enabled: 1) and (max-width: 768px), (pointer: coarse) and (max-width: 768px) {
68+
@media (pointer: coarse) and (max-width: 768px) {
6969
border-color: var(--color5);
7070
}
7171
}
@@ -75,7 +75,7 @@
7575
border-color: var(--color5);
7676
}
7777

78-
@media (-moz-touch-enabled: 1) and (max-width: 768px), (pointer: coarse) and (max-width: 768px) {
78+
@media (pointer: coarse) and (max-width: 768px) {
7979
border-color: var(--color5);
8080
}
8181
}

frontend/apps/remark42/app/components/comment/comment-votes.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
padding: 2px;
2222
opacity: 0.4;
2323
color: var(--color13);
24-
transition: opacity 0.15s color 0.15s;
24+
transition: opacity 0.15s, color 0.15s;
2525
}
2626

2727
.root:hover .voteButton {

frontend/apps/remark42/app/components/comment/comment.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
.comment-form_type_reply {
3131
margin-left: 17px;
3232

33-
@media (-moz-touch-enabled: 1) and (max-width: 768px), (pointer: coarse) and (max-width: 768px) {
33+
@media (pointer: coarse) and (max-width: 768px) {
3434
margin-left: 0;
3535
}
3636
}

frontend/apps/remark42/app/components/comment/raw-content.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.raw-content {
2-
word-wrap: break-word;
2+
overflow-wrap: break-word;
33

44
& > *:first-child {
55
margin-top: 0;

frontend/apps/remark42/app/components/icon-button/icon-button.module.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
border: 0;
55
margin: 0;
66
padding: 4px;
7-
transition: transfrom 0.15s ease-out;
7+
transition: transform 0.15s ease-out;
88
border-radius: 2px;
99
appearance: none;
1010

1111
&:hover {
1212
transform: scale(1.06);
13-
transition: transfrom 0.15s ease-in;
13+
transition: transform 0.15s ease-in;
1414
}
1515

1616
&:active {

0 commit comments

Comments
 (0)