Skip to content

Commit 159fafd

Browse files
authored
Better string highlight (#462)
Better string highlight
2 parents e0cb9ae + 5df1949 commit 159fafd

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

src/assets/toolkit/styles/vendor/prism.css

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,17 @@
1616
}
1717

1818
.token.property,
19-
.token.keyword {
19+
.token.keyword,
20+
.token.interpolation-punctuation {
2021
color: color-mod(var(--color-blue) h(-15) s(+50%) l(+20%));
2122
}
2223

2324
.token.constant,
2425
.token.attr-value,
2526
.token.selector,
26-
.token.class-name {
27-
color: color-mod(var(--color-green) l(+17%));
27+
.token.class-name,
28+
:matches(.language-js, .language-javascript) .token.string {
29+
color: color-mod(var(--color-green) l(+25%) s(-20%));
2830
}
2931

3032
.token.rule,

src/patterns/components/cms-content/base.hbs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,26 @@ repos = indexedRepos.sort((a, b) => {
5858
return a.index < b.index ? -1 : 1;
5959
}
6060
return a.language < b.language ? -1 : 1;
61-
});</code></pre>
61+
});
62+
63+
// Set up a resolved promise for our loop
64+
let step = Promise.resolve();
65+
66+
// For every frame we need to generate…
67+
for (let i = 0; i &lt;= frames; i++) {
68+
let position = duration / frames * i;
69+
let filename = `whut-${filePrefix}${i}${fileScale}${fileExtension}`;
70+
// Begin this step when the previous finishes
71+
step = step.then(() => {
72+
timeline.pause(position);
73+
return svgAsPngUri(document.getElementById("amoeba"), { scale }).then(
74+
uri => {
75+
// Convert data URI to plain base64
76+
let imgDataIndex = uri.indexOf("base64,") + "base64,".length;
77+
let imgData = uri.substr(imgDataIndex);
78+
zip.file(filename, imgData, { base64: true });
79+
}
80+
);
81+
});
82+
}</code></pre>
6283
</article>

0 commit comments

Comments
 (0)