Browse Source

support lang.css

Gregg Tavares 5 years ago
parent
commit
112104c1ef

+ 4 - 0
build/templates/index.template

@@ -73,6 +73,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 <link rel="apple-touch-icon" href="/threejs/lessons/resources/threejsfundamentals-icon.png">
 <link rel="icon" href="/threejs/lessons/resources/threejsfundamentals-icon.png">
 
+<link rel="stylesheet" href="/threejs/lessons/lang.css" />
+{{#ifexists filename="/threejs/lessons/{{langCode}}/lang.css" langCode=langInfo.baseDirname}}
+<link rel="stylesheet" href="/threejs/lessons/{{langInfo.baseDirname}}/lang.css" />
+{{/ifexists}}
 <link rel="stylesheet" href="/threejs/lessons/resources/lesson.css" />
 <link rel="stylesheet" href="/threejs/lessons/resources/index.css" />
 </head>

+ 5 - 0
build/templates/lesson.template

@@ -95,6 +95,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 <link href="/threejs/lessons/resources/threejsfundamentals-icon.png" rel="shortcut icon" type="image/png">
 <link rel="apple-touch-icon" href="/threejs/lessons/resources/threejsfundamentals-icon.png">
 <link rel="icon" href="/threejs/lessons/resources/threejsfundamentals-icon.png">
+
+<link rel="stylesheet" href="/threejs/lessons/lang.css" />
+{{#ifexists filename="/threejs/lessons/{{langCode}}/lang.css" langCode=langInfo.baseDirname}}
+<link rel="stylesheet" href="/threejs/lessons/{{langInfo.baseDirname}}/lang.css" />
+{{/ifexists}}
 <link rel="stylesheet" href="/threejs/lessons/resources/lesson.css" />
 </head>
 <body>

+ 8 - 0
threejs/lessons/lang.css

@@ -0,0 +1,8 @@
+:root {
+  --article-font-family: Georgia, serif;
+  --headline-font-family: sans-serif;
+  /* a block of code */
+  --code-block-font-family: "Lucida Console", Monaco, monospace;
+  /* a word in a sentence */
+  --code-font-family: monospace;
+}

+ 7 - 7
threejs/lessons/resources/lesson.css

@@ -1,7 +1,7 @@
 
 body {
   margin: 0;
-  font-family: Georgia, serif;
+  font-family: var(--article-font-family);
   font-size: 19px;
   line-height: 150%;
 }
@@ -50,7 +50,7 @@ pre.prettyprint li {
 }
 pre.prettyprint code, .dos {
     color: #CCC;
-    font-family: "Lucida Console", Monaco, monospace;
+    font-family: var(--code-block-font-family);
     display: block;
 }
 
@@ -75,7 +75,7 @@ div[data-diagram] {
   flex: 1 1 100%;
 }
 .spread .code {
-  font-family: monospace;
+  font-family: var(--code-font-family);
 }
 .spread .code>div {
   text-align: left;
@@ -239,7 +239,7 @@ div[data-diagram] {
     text-indent: -1em;
 }
 h1, h2, h3, h4 {
-  font-family: sans-serif;
+  font-family: var(--headline-font-family);
   line-height: 1.2;
 }
 h3 {
@@ -247,7 +247,7 @@ h3 {
 }
 code {
     color: black;
-    font-family: monospace;
+    font-family: var(--code-font-family);
     background-color: #ddd;
     padding: 0.1em 0.2em 0.1em 0.2em;
     border-radius: 0.5em;
@@ -417,7 +417,7 @@ pre.prettyprint, code.prettyprint, .dos {
     border: 1px solid #000;
     box-shadow: 10px 10px 0px #ccc;
     font-size: 9pt;
-    font-family: "Lucida Console", Monaco, monospace;
+    font-family: var(--code-block-font-family);
     margin: auto;
     padding: 1em;
     text-align: left;           /* override justify on body */
@@ -469,7 +469,7 @@ pre.prettyprint.lighttheme .fun { color: #900; }  /* function name */
         color: #000;
         background: #EEE;
         font-size: 8pt;
-        font-family: "Lucida Console", Monaco, monospace;
+        font-family: var(--code-block-font-family);
         width: 95%;
         margin: auto;
         padding: 1em;