Skip to content

Commit 636ce93

Browse files
comparable examples for brand yaml
similar in spirit to feature-format matrix comparison but there are so many feature-element combinations that it's not feasible to demonstrate them individually the aim is to have full-enough coverage of all feature-element options over a small number of visual tests
1 parent 3e4491d commit 636ce93

File tree

6 files changed

+105
-21
lines changed

6 files changed

+105
-21
lines changed

tests/docs/brand-yaml/kitchen-sink/_brand.yml

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@ color:
22
palette:
33
red: "#FF0000"
44
black: "#002040"
5-
# white: "#e6f8ff"
6-
branded-base-foreground: "#27262e"
7-
branded-headings-foreground: "#042f02"
8-
branded-monospace-inline-foreground: rgb(8, 111, 15)
9-
branded-monospace-inline-background: rgb(255, 250, 224)
10-
branded-monospace-block-foreground: "#eee"
11-
branded-monospace-block-background: "#0a3c07"
125

136
primary: red
147
foreground: black
@@ -31,7 +24,7 @@ typography:
3124
base:
3225
family: EB Garamond
3326
# sass fails to typecheck
34-
#size: 12pt
27+
size: 12pt
3528
weight: 400
3629
color: "#21f"
3730
line-height: 0.9
@@ -42,23 +35,17 @@ typography:
4235
color: "#2c2"
4336
monospace:
4437
family: Space Mono
45-
color: "#f32"
46-
background-color: white
4738
monospace-inline:
4839
size: 20px
4940
weight: 700
41+
color: "#f32"
42+
background-color: white
5043
monospace-block:
5144
weight: 400
5245
size: 8pt
5346
line-height: 2
54-
# does not work in revealjs
55-
# monospace-inline:
56-
# color: branded-monospace-inline-foreground
57-
# background-color: branded-monospace-inline-background
58-
# monospace-block:
59-
# color: branded-monospace-block-foreground
60-
# weight: 400
61-
# background-color: branded-monospace-block-background
47+
color: "#eee"
48+
background-color: "#0a3c07"
6249
link:
6350
color: "#a2f"
6451
weight: 700

tests/docs/brand-yaml/kitchen-sink/brand-typography.qmd

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,19 @@ format:
1414

1515
## heading-2 is gothic a1 italic 700
1616

17-
Paragraph is blue eb garamond normal 400 with line-height 0.9; currently we get a sass compilation error if we set base.size to an absolute length unit.
17+
Paragraph is 12pt blue eb garamond normal 400 with line-height 0.9.
1818

19-
Here's a monospace inline in space mono normal 700 20px: `fib(90) // in red on white` \
20-
and here's a monospace block in space mono normal 400 8pt with line-height 2:
19+
Here's a monospace inline in 20px space mono normal 700, red on white: `fib(90)` \
20+
and here's a monospace block in 8pt space mono normal 400, white on dark green, with line-height 2:
2121

22+
:::{.sourceCode}
23+
```
24+
const fib = num => num < 2 ? num : fib(num-1) + fib(num - 2);
25+
console.log(fib(12));
26+
```
27+
:::
28+
29+
Syntax highlighting makes colors more complicated:
2230
```javascript
2331
const fib = num => num < 2 ? num : fib(num-1) + fib(num - 2);
2432
console.log(fib(12))
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
color:
2+
## ERROR: Expecting punctuation: "}" if no palette
3+
palette:
4+
orangeblue: "#ccc"
5+
background: "#e6f8ff"
6+
typography:
7+
monospace:
8+
color: "#eee"
9+
background-color: "#0a3c07"
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: monospace colors
3+
format:
4+
typst:
5+
keep-typ: true
6+
include-in-header:
7+
text: |
8+
#set text(fallback: false, weight: 100)
9+
dashboard: default
10+
html: default
11+
revealjs: default
12+
---
13+
14+
We're using only `brand.typography.monospace.color` and `.background-color`.
15+
16+
Raw inlines `3 * fib(5)` and raw blocks will inherit the same colors, off-white and dark green.
17+
18+
:::{.sourceCode}
19+
```
20+
const fib = num => num < 2 ? num : fib(num-1) + fib(num - 2);
21+
console.log(fib(12))
22+
```
23+
:::
24+
25+
Syntax highlighting complicates things.
26+
27+
```javascript
28+
const fib = num => num < 2 ? num : fib(num-1) + fib(num - 2);
29+
console.log(fib(12))
30+
```
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
color:
2+
## ERROR: Expecting punctuation: "}" if no palette
3+
palette:
4+
orangeblue: "#ccc"
5+
branded-monospace-inline-foreground: rgb(8, 111, 15)
6+
branded-monospace-inline-background: rgb(255, 250, 224)
7+
branded-monospace-block-foreground: "#E7DADA"
8+
branded-monospace-block-background: rgb(14, 85, 10)
9+
background: "#e6f8ff"
10+
typography:
11+
# does not work in revealjs
12+
monospace-inline:
13+
color: branded-monospace-inline-foreground
14+
background-color: branded-monospace-inline-background
15+
monospace-block:
16+
color: branded-monospace-block-foreground
17+
weight: 400
18+
background-color: branded-monospace-block-background
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
title: colors from brand palette
3+
format:
4+
typst:
5+
keep-typ: true
6+
include-in-header:
7+
text: |
8+
#set text(fallback: false, weight: 100)
9+
dashboard: default
10+
html: default
11+
revealjs: default
12+
---
13+
14+
We're setting `color` and `background-color` on `brand.typography.monospace-inline` and `.monospace-block` to named colors in the `brand.color.palette`.
15+
16+
Raw inlines `3 * fib(5)` are displayed in green on yellow.
17+
18+
Raw blocks are displayed in pink grey on dark green.
19+
20+
:::{.sourceCode}
21+
```
22+
const fib = num => num < 2 ? num : fib(num-1) + fib(num - 2);
23+
console.log(fib(12))
24+
```
25+
:::
26+
27+
Syntax highlighting complicates things.
28+
29+
```javascript
30+
const fib = num => num < 2 ? num : fib(num-1) + fib(num - 2);
31+
console.log(fib(12))
32+
```

0 commit comments

Comments
 (0)