Skip to content

Commit f547b27

Browse files
Fix markdown checkboxes on Blink (#13988)
Blink still requires a vendor prefix for `mask-image` and `mask-size`, so add that here to fix the rendering. Co-authored-by: techknowlogick <[email protected]>
1 parent 27d0a55 commit f547b27

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

web_src/less/_base.less

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@
101101
--color-code-bg: #ffffff;
102102
--color-markdown-code-block: #00000010;
103103
--color-secondary-bg: #f4f4f4;
104+
/* backgrounds */
105+
--checkbox-mask-checked: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="-1 -1 18 18" width="16" height="16"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg>');
106+
--checkbox-mask-indeterminate: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M2 7.75A.75.75 0 012.75 7h10a.75.75 0 010 1.5h-10A.75.75 0 012 7.75z"></path></svg>');
104107
}
105108

106109
:root:lang(ja) {

web_src/less/_markdown.less

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,16 +203,19 @@
203203
pointer-events: none;
204204
background: var(--color-text);
205205
mask-size: cover;
206+
-webkit-mask-size: cover;
206207
}
207208

208209
input[type="checkbox"]:checked::after {
209210
content: "";
210-
mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="-1 -1 18 18" width="16" height="16"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg>');
211+
mask-image: var(--checkbox-mask-checked);
212+
-webkit-mask-image: var(--checkbox-mask-checked);
211213
}
212214

213215
input[type="checkbox"]:indeterminate::after {
214216
content: "";
215-
mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M2 7.75A.75.75 0 012.75 7h10a.75.75 0 010 1.5h-10A.75.75 0 012 7.75z"></path></svg>');
217+
mask-image: var(--checkbox-mask-indeterminate);
218+
-webkit-mask-image: var(--checkbox-mask-indeterminate);
216219
}
217220

218221
ul ul,

0 commit comments

Comments
 (0)