We’ve just installed Prism.js and got it working.
In this screencast we find a theme called the Tomorrow Theme and ingrate it’s colors into the syntax highlighting. We make a little color key at the top of the file for quick reference. We also make some guesses as to what is what, at least to start. What we end up with, color wise, is OK but not spectacular. If you browse around the site today, you’ll notice the color theme is more like Twilight, which I used to love in TextMate and I’m currently loving in Sublime Text 2.
We finish up by adding the header bars to code snippets. We don’t have actual markup do this (which is probably good, it’s mostly just a decorator) we add it through using a pseudo element and generated content via the rel
attribute on the code. Most of the existing code on CSS-Tricks has this attribute. If it doesn’t, not a big deal. We aren’t really using rel
in the correct way here, but I’m not overly worried about it.
pre[rel]:before {
content: attr(rel);
}
We run into a little problem with making that pseudo element 100% wide with padding. Turns out our box-sizing declaration on the * selector doesn’t affect pseudo elements (kinda makes sense), so we update our Normalize to include that.
Im pretty sure I read this on your blog… wasn’t the problem that the universal selector that you used to apply box sizing doesn’t apply to ::before and ::after unless you do *::before and *::after ??
Correct! So we add that and fix it =)
Is this still being used on css-tricks? And is there a way to get the theme from here?