Skip to content

Commit 68f8a57

Browse files
brand extension: logo and typography tests
note, we don't yet support brand fonts from file in HTML #12501 so that is not tested here.
1 parent 5efaa26 commit 68f8a57

File tree

15 files changed

+168
-0
lines changed

15 files changed

+168
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/.quarto/
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
title: My-brand
2+
author: Gordon Woodhull
3+
version: 1.0.0
4+
quarto-required: ">=99.9.0"
5+
contributes:
6+
metadata:
7+
project:
8+
brand: mybrand.yml
67.8 KB
Loading
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
logo:
2+
images:
3+
sun:
4+
path: sun-face.png
5+
alt: sun face
6+
moon:
7+
path: moon-face.png
8+
alt: moon face
9+
medium:
10+
light: sun
11+
dark: moon
12+
color:
13+
background:
14+
light: "#def"
15+
dark: "#042"
16+
foreground:
17+
light: "#411"
18+
dark: "#ffe"
80.7 KB
Loading
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
project:
2+
type: website
3+
format:
4+
html:
5+
theme:
6+
light: brand
7+
dark: [brand, dark-fixups.scss]
8+
website:
9+
sidebar:
10+
style: "docked"
11+
search: true
12+
contents:
13+
- test.qmd
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/*-- scss:rules --*/
2+
3+
nav.sidebar.sidebar-navigation:not(.rollup) {
4+
background-color: #282b30;
5+
}
6+
7+
nav.navbar {
8+
background-color: rgba(13, 251, 108, 0.14);
9+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
title: test brand extension
3+
format:
4+
html: default
5+
dashboard: default
6+
revealjs: default
7+
typst:
8+
output-ext: typ
9+
_quarto:
10+
tests:
11+
html:
12+
ensureFileRegexMatches:
13+
-
14+
- '<img src="site_libs(/|\\)quarto-contrib(/|\\)quarto-project(/|\\)my-brand(/|\\)sun-face\.png" alt="sun face" class=".*light-content.*">'
15+
- '<img src="site_libs(/|\\)quarto-contrib(/|\\)quarto-project(/|\\)my-brand(/|\\)moon-face\.png" alt="moon face" class=".*dark-content.*">'
16+
- []
17+
dashboard:
18+
ensureFileRegexMatches:
19+
-
20+
- '<img src="site_libs(/|\\)quarto-contrib(/|\\)quarto-project(/|\\)my-brand(/|\\)sun-face\.png" alt="sun face" class=".*light-content.*">'
21+
- '<img src="site_libs(/|\\)quarto-contrib(/|\\)quarto-project(/|\\)my-brand(/|\\)moon-face\.png" alt="moon face" class=".*dark-content.*">'
22+
- []
23+
revealjs:
24+
ensureFileRegexMatches:
25+
-
26+
- '<img src="site_libs(/|\\)quarto-contrib(/|\\)quarto-project(/|\\)my-brand(/|\\)sun-face\.png" alt="sun face".*>'
27+
-
28+
- 'moon-face'
29+
typst:
30+
ensureTypstFileRegexMatches:
31+
-
32+
- 'background: align\(left\+top, box\(inset: 0.75in, image\("_extensions(/|\\\\)my-brand(/|\\\\)sun-face.png", width: 1\.5in, alt: "sun face"\)\)'
33+
-
34+
- 'image.*moon-face'
35+
---
36+
37+
# brand.yml extension
38+
39+
Here is some inline code `def foo(x): return x`{.python} and `y`{.python} and `z`{.python}.
40+
41+
42+
{{< lipsum 1 >}}
43+
44+
```{.python}
45+
# | echo: true
46+
print(1+2)
47+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
title: Typst-brand-typography-example
2+
author: Gordon Woodhull
3+
version: 1.0.0
4+
quarto-required: ">=99.9.0"
5+
contributes:
6+
metadata:
7+
project:
8+
brand: brand.yml
9+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
typography:
2+
fonts:
3+
- family: "Open Sans"
4+
source: file
5+
files:
6+
- resources/fonts/opensans/OpenSans-VariableFont_wdth,wght.ttf
7+
- family: "Fira Code"
8+
source: file
9+
files:
10+
- resources/fonts/firacode/FiraCode-VF.ttf
11+
- family: "Roboto Slab"
12+
source: file
13+
files:
14+
- path: resources/fonts/robotoslab/RobotoSlab-VariableFont_wght.ttf
15+
weight: 600
16+
style: normal
17+
base:
18+
family: Open Sans
19+
line-height: 1.25em
20+
size: 1rem
21+
headings:
22+
family: Roboto Slab
23+
color: primary
24+
weight: 600
25+
monospace:
26+
family: Fira Code
27+
size: 0.9em

0 commit comments

Comments
 (0)