@@ -374,7 +374,7 @@ <h2 id=defining-variables><span class=secno>2. </span> Defining Variables
374374 the document. Its value can be referenced via the "header-color"
375375 variable:
376376
377- < pre > h1 { background-color: var( header-color) ; }</ pre >
377+ < pre > h1 { background-color: $ header-color; }</ pre >
378378
379379 < p > The preceding rule is equivalent to writing ‘< code
380380 class =css > background-color: #06c;</ code > ’, except that the variable
@@ -400,7 +400,7 @@ <h2 id=defining-variables><span class=secno>2. </span> Defining Variables
400400:root { var-color: blue; }
401401div { var-color: green; }
402402#alert { var-color: red; }
403- * { color: var( color) ; }
403+ * { color: $ color; }
404404
405405<p> I inherited blue from the root element!</p>
406406<div> I got green set directly on me!</div>
@@ -425,7 +425,7 @@ <h2 id=defining-variables><span class=secno>2. </span> Defining Variables
425425 < pre >
426426:root {
427427 var-main-color: #c06;
428- var-accent-background: linear-gradient(to top, var( main-color) , white);
428+ var-accent-background: linear-gradient(to top, $ main-color, white);
429429}</ pre >
430430
431431 < p > The ‘< code class =property > var-accent-background</ code > ’ property
@@ -439,8 +439,8 @@ <h2 id=defining-variables><span class=secno>2. </span> Defining Variables
439439
440440 < pre >
441441:root {
442- var-one: calc(var( two) + 20px);
443- var-two: calc(var( one) - 20px);
442+ var-one: calc($ two + 20px);
443+ var-two: calc($ one - 20px);
444444}</ pre >
445445
446446 < p > Both ‘< code class =property > var-one</ code > ’ and ‘< code
@@ -465,8 +465,8 @@ <h2 id=defining-variables><span class=secno>2. </span> Defining Variables
465465 < pre >
466466<one> <two> <three /> </two> </one>
467467one { var-foo: 10px; }
468- two { var-bar: calc(var( foo) + 10px); }
469- three { var-foo: calc(var( bar) + 10px); }</ pre >
468+ two { var-bar: calc($ foo + 10px); }
469+ three { var-foo: calc($ bar + 10px); }</ pre >
470470
471471 < p > The <one> element defines a value for ‘< code
472472 class =property > var-foo</ code > ’. The <two> element inherits this
@@ -491,32 +491,7 @@ <h2 id=defining-variables><span class=secno>2. </span> Defining Variables
491491 variable an < a href ="#invalid-variable "> < i > invalid variable</ i > </ a > . This
492492 is represented by the keyword ‘< code class =css > invalid</ code > ’, but
493493 that keyword has no special meaning in itself, and is valid if set
494- explicitly in a variable property.
495-
496- < div class =example >
497- < pre >
498- <div>
499- <p> Sample text</p>
500- </div>
501- <style>
502- p { var-foo: invalid; }
503- div,p { font-family: var(foo); }
504- </style> </ pre >
505-
506- < p > In this example, the "foo" variable is an < a
507- href ="#invalid-variable "> < i > invalid variable</ i > </ a > at the time the DIV
508- element references it, because the ‘< code
509- class =property > var-foo</ code > ’ property still has its initial value.
510- This causes the DIV's ‘< code class =property > font-family</ code > ’
511- property to compute to the initial value for ‘< code
512- class =property > font-family</ code > ’.
513-
514- < p > On the other hand, the P element defines an explicit value for the
515- ‘< code class =property > var-foo</ code > ’ property. Its ‘< code
516- class =property > font-family</ code > ’ property thus references a font
517- named "invalid".
518- </ div >
519- <!--
494+ explicitly in a variable property. <!--
520495UUUUUUUU UUUUUUUU iiii
521496U::::::U U::::::U i::::i
522497U::::::U U::::::U iiii
@@ -541,6 +516,7 @@ <h2 id=defining-variables><span class=secno>2. </span> Defining Variables
541516 ggg::::::ggg
542517 gggggg
543518-->
519+
544520
545521 < h2 id =using-variables > < span class =secno > 3. </ span > Using Variables</ h2 >
546522
@@ -739,7 +715,7 @@ <h3 id=using-invalid-variables><span class=secno>3.4. </span> Using Invalid
739715 < pre >
740716:root { var-not-a-color: 20px; }
741717p { background-color: red; }
742- p { background-color: var( not-a-color) ; }</ pre >
718+ p { background-color: $ not-a-color; }</ pre >
743719
744720 < p > the <p> elements will have transparent backgrounds (the initial
745721 value for ‘< code class =property > background-color</ code > ’), rather
0 commit comments