Skip to content

Commit

Permalink
Better string highlight (#462)
Browse files Browse the repository at this point in the history
Better string highlight
  • Loading branch information
tylersticka authored Nov 8, 2019
2 parents e0cb9ae + 5df1949 commit 159fafd
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/assets/toolkit/styles/vendor/prism.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,17 @@
}

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

.token.constant,
.token.attr-value,
.token.selector,
.token.class-name {
color: color-mod(var(--color-green) l(+17%));
.token.class-name,
:matches(.language-js, .language-javascript) .token.string {
color: color-mod(var(--color-green) l(+25%) s(-20%));
}

.token.rule,
Expand Down
23 changes: 22 additions & 1 deletion src/patterns/components/cms-content/base.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,26 @@ repos = indexedRepos.sort((a, b) => {
return a.index < b.index ? -1 : 1;
}
return a.language < b.language ? -1 : 1;
});</code></pre>
});

// Set up a resolved promise for our loop
let step = Promise.resolve();

// For every frame we need to generate…
for (let i = 0; i &lt;= frames; i++) {
let position = duration / frames * i;
let filename = `whut-${filePrefix}${i}${fileScale}${fileExtension}`;
// Begin this step when the previous finishes
step = step.then(() => {
timeline.pause(position);
return svgAsPngUri(document.getElementById("amoeba"), { scale }).then(
uri => {
// Convert data URI to plain base64
let imgDataIndex = uri.indexOf("base64,") + "base64,".length;
let imgData = uri.substr(imgDataIndex);
zip.file(filename, imgData, { base64: true });
}
);
});
}</code></pre>
</article>

0 comments on commit 159fafd

Please sign in to comment.