docs: document string interpolation syntax and update code examples across docs and site

Add a new "Interpolation" section to the values documentation explaining the `%(expr)` syntax with examples of complex expressions and nested interpolation. Update all code samples in README.md, getting-started.markdown, and index.markdown to use the new interpolation syntax instead of string concatenation. Adjust syntax highlighting in style.scss by adding a new `.si` class for interpolation spans with distinct background color, and tweak existing color values for strings, numbers, and keywords to improve visual distinction. Add the `\%` escape sequence to the list of supported escape characters in values.markdown.
This commit is contained in:
Bob Nystrom
2015-11-21 17:20:50 +00:00
parent 920b3e2a32
commit fa1c1f5cda
5 changed files with 29 additions and 7 deletions
+7 -4
View File
@@ -270,7 +270,7 @@ footer {
span.c1, span.cm { color: mix($code-color, $code-bg, 60%); }
// Keywords.
span.k, span.kd, span.kc, span.nb { color: hsl(200, 60%, 50%); }
span.k, span.kd, span.kc, span.nb { color: hsl(200, 70%, 50%); }
// Names.
span.vg { color: hsl(180, 70%, 35%); }
@@ -278,11 +278,14 @@ footer {
span.vc { color: hsl(130, 60%, 40%); }
// Numbers.
span.m, span.mi, span.mf { color: hsl(30, 80%, 45%); }
span.m, span.mi, span.mf { color: hsl(90, 40%, 50%); }
// Strings.
span.s, span.s2 { color: hsl(40, 80%, 45%); }
span.se { color: hsl(45, 80%, 50%); }
span.s, span.s2 { color: hsl(40, 90%, 40%); }
// Escape.
span.se { color: hsl(50, 90%, 45%); }
// Interpolation.
span.si { color: hsl(50, 90%, 40%); background: hsl(40, 90%, 95%); }
// Operators and punctuation.
span.o { color: hsl(200, 40%, 50%); }