Skip to content

Commit ffe6509

Browse files
committed
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
1 parent 0105bc2 commit ffe6509

File tree

8 files changed

+9
-13
lines changed

8 files changed

+9
-13
lines changed

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.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/styles/global.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ body {
66
font-family: system-ui;
77
font-size: 14px;
88
color: rgb(var(--primary-text-color));
9+
background: transparent;
910
box-sizing: border-box;
1011
}
1112

frontend/apps/remark42/app/utils/create-iframe.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,8 @@ export function createIframe({ __colors__, styles, ...params }: Params) {
1010
setAttributes(iframe, {
1111
src: `${BASE_URL}/web/iframe.html?${query}`,
1212
name: JSON.stringify({ __colors__ }),
13-
frameborder: '0',
14-
allowtransparency: 'true',
15-
scrolling: 'no',
1613
tabindex: '0',
1714
title: 'Comments | Remark42',
18-
horizontalscrolling: 'no',
19-
verticalscrolling: 'no',
2015
});
2116
setStyles(iframe, {
2217
height: '100%',

frontend/apps/remark42/templates/demo.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
<div class="widgets">
7474
<div class="widget widgets__widget widgets__comments-widget">
7575
<a class="widget__link" href="<%= htmlWebpackPlugin.options.REMARK_URL %>/web/last-comments.html">Last comments widget page</a><br />
76-
<iframe class="widget__frame widget__comments-frame" src="<%= htmlWebpackPlugin.options.REMARK_URL %>/web/last-comments.html" frameborder="0"></iframe>
76+
<iframe class="widget__frame widget__comments-frame" src="<%= htmlWebpackPlugin.options.REMARK_URL %>/web/last-comments.html" style="border:none"></iframe>
7777
</div>
7878
<div class="widget widgets__widget widgets__counter-widget">
7979
<a class="widget__link" href="<%= htmlWebpackPlugin.options.REMARK_URL %>/web/counter.html">Counter widget page</a><br />

0 commit comments

Comments
 (0)