Skip to content

Commit 6bfc93d

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 bc31efd commit 6bfc93d

File tree

14 files changed

+162
-0
lines changed

14 files changed

+162
-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: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
title: test brand extension
3+
format:
4+
html: default
5+
dashboard: default
6+
# ERROR: NotFound: No such file or directory (os error 2): rename
7+
# '/Users/gordon/src/quarto-cli/tests/docs/smoke-all/brand/logo/logo-extension/test.html' ->
8+
# '/Users/gordon/src/quarto-cli/tests/docs/smoke-all/brand/logo/logo-extension/_site/test.html'
9+
# revealjs: default
10+
typst:
11+
output-ext: typ
12+
_quarto:
13+
tests:
14+
html:
15+
ensureHtmlElements:
16+
-
17+
- 'img[class*="light-content"][src="site_libs/quarto-contrib/quarto-project/my-brand/sun-face.png"][alt="sun face"]'
18+
- 'img[class*="dark-content"][src="site_libs/quarto-contrib/quarto-project/my-brand/moon-face.png"][alt="moon face"]'
19+
- []
20+
dashboard:
21+
ensureHtmlElements:
22+
-
23+
- 'img[src="site_libs/quarto-contrib/quarto-project/my-brand/sun-face.png"][alt="sun face"][class="navbar-logo light-content d-inline-block"]'
24+
- 'img[src="site_libs/quarto-contrib/quarto-project/my-brand/moon-face.png"][alt="moon face"][class="navbar-logo dark-content d-inline-block"]'
25+
- []
26+
typst:
27+
ensureTypstFileRegexMatches:
28+
-
29+
- 'background: align\(left\+top, box\(inset: 0.75in, image\("_extensions(/|\\\\)my-brand(/|\\\\)sun-face.png", width: 1\.5in, alt: "sun face"\)\)'
30+
- []
31+
---
32+
33+
# brand.yml extension
34+
35+
Here is some inline code `def foo(x): return x`{.python} and `y`{.python} and `z`{.python}.
36+
37+
38+
{{< lipsum 1 >}}
39+
40+
```{.python}
41+
# | echo: true
42+
print(1+2)
43+
```
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)