You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/authoring/brand.qmd
+30-91Lines changed: 30 additions & 91 deletions
Original file line number
Diff line number
Diff line change
@@ -166,15 +166,7 @@ logo:
166
166
medium: logo.png
167
167
```
168
168
169
-
You can specify a local file path, relative to the location of `_brand.yml`, or a URL that starts with `http://` or `https://`.
170
-
171
-
::: {.callout-warning}
172
-
173
-
## Limitation
174
-
175
-
Logos specified as URLs are not currently supported in `format: typst`.
176
-
177
-
:::
169
+
You can specify a local file path, relative to the location of `_brand.yml`, or a URL.
178
170
179
171
A single logo may not work well in all locations so **brand.yml** allows you to set three different logos: `small`, `medium` and `large`. For example:
180
172
@@ -338,46 +330,40 @@ The supported fields are generally described as follows:
338
330
339
331
[Defaults in the **brand.yml** docs](https://posit-dev.github.io/brand-yml/brand/defaults.html){.external}
340
332
341
-
The `defaults` section of **brand.yml** allows users to set option for specific tools that don't otherwise fit into the **brand.yml** schema. In particular, Quarto supports `defaults: quarto` and `defaults: bootstrap`.
342
-
343
-
#### Quarto
333
+
The `defaults` section of **brand.yml** allows users to set options for specific tools that don't otherwise fit into the **brand.yml** schema. Quarto's implementation currently supports `defaults: bootstrap`.
344
334
345
-
Quarto merges options you set in `defaults: quarto` with document metadata. For example, you can use this to set format specific options like syntax highlighting for `html`:
335
+
#### Bootstrap
346
336
347
-
```{.yaml filename="_brand.yml"}
348
-
defaults:
349
-
quarto:
350
-
format:
351
-
html:
352
-
highlight-style: github
353
-
```
337
+
The `bootstrap` section follows [**brand.yml**](https://posit-dev.github.io/brand-yml/brand/defaults.html).
338
+
**brand.yml** specifies the behavior of a `defaults` key inside `bootstrap`, with key-value pairs
339
+
corresponding to SCSS variable name-value pairs.
340
+
In addition to the `defaults` key, Quarto supports `uses`, `functions`, `mixins` and `rules`.
341
+
These keys all take a string value that will be used for the appropriate [layer](/docs/output-formats/html-themes-more.qmd).
354
342
355
-
Or, you might change the `logo` options for `typst`:
343
+
Consider the following, building on our working example:
356
344
357
345
```{.yaml filename="_brand.yml"}
346
+
## Add this entry to the `_brand.yml` example above
358
347
defaults:
359
-
quarto:
360
-
format:
361
-
typst:
362
-
logo:
363
-
location: left-bottom
348
+
bootstrap:
349
+
defaults: # defaults also supports a string as its value
350
+
link-decoration: underline
351
+
navbar-fg: "#fff"
352
+
# uses: <string>
353
+
# functions: <string>
354
+
# mixins: <string>
355
+
# rules: <string>
364
356
```
365
357
366
-
::: callout-note
367
-
## Set all formats in document metadata
368
-
369
-
Because of the merging behavior of `format`, if you set format specific options in `defaults: quarto`, you'll need to set all the required formats in document metadata:
{.lightbox group="brand-bootstrap-defaults" fig-alt="Screenshot of a webpage. The text is dark grey on a light blue background, using a rounded sans-serif typeface, a logo appears in the navbar."}
376
361
:::
377
362
378
-
#### Bootstrap
379
-
380
-
*How relevant is `defaults: bootstrap`? Example? WHere do you find out what you can put under `bootstrap`?*
363
+
::: {}
364
+
{.lightbox group="brand-bootstrap-defaults" fig-alt="Screenshot of a webpage. It looks identical to the previous image, except for underlined links and white text on the navbar."}
365
+
:::
366
+
:::::::
381
367
382
368
### Meta
383
369
@@ -442,62 +428,19 @@ You can't currently access `typography`, `meta`, or `defaults` values using the
442
428
443
429
### In SCSS
444
430
445
-
The colors defined in `palette` are set as SCSS variables of the form `brand-COLOR_NAME`.
446
-
For example, if `_brand.yml` defines `blue`:
431
+
If `_brand.yml` defines `color: blue`:
447
432
448
433
```{.yaml filename="_brand.yml"}
449
434
color:
450
435
palette:
451
436
blue: "#ddeaf1"
452
437
```
453
438
454
-
Then the variable `$brand-blue` is will be set to `#ddeaf1` in the `defaults` layer of [Quarto's SCSS layering system](/docs/output-formats/html-themes-more.html#bootstrap-bootswatch-layering).
455
-
You can add a custom SCSS file, `styles.scss`, in the usual way:
456
-
```{.yaml filename="_quarto.yml"}
457
-
format:
458
-
html:
459
-
theme: [styles.scss]
460
-
```
439
+
This should work:
461
440
462
-
Then `styles.scss` can use these brand variables to make style tweaks.
463
-
For example, you might want all `h1` elements to be `blue`:
464
-
465
-
```{.scss filename="styles.scss"}
466
-
/*-- scss:rules --*/
467
-
468
-
h1 {
469
-
color: $brand-blue;
470
-
}
471
-
```
472
-
473
-
When you specify SCSS files without an explicit `brand` element, it is equivalant to listing them after `brand`.
474
-
For instance, the above `theme` is equivalant to:
475
-
476
-
```{.yaml filename="_quarto.yml"}
477
-
format:
478
-
html:
479
-
theme: [brand, styles.scss]
480
-
```
481
-
482
-
This order doesn't matter when you are setting items in the `/*-- scss:rules --*/` layer, because `rules` are layered on after `defaults`.
483
-
484
-
However, if you want to set a [Quarto SASS variable](https://quarto.org/docs/output-formats/html-themes.html#sass-variables) you'll use the `/*-- scss:defaults --*/` layer and the order of items in `theme` will matter.
485
-
486
-
As an example, consider setting the navigation bar background to the `blue` brand color:
487
-
488
-
```{.scss filename="nav.scss"}
441
+
```{.scss filename="custom.scss"}
489
442
/*-- scss:defaults --*/
490
-
491
-
$navbar-bg: $brand-blue;
492
-
```
493
-
494
-
Because of the way Quarto layers SCSS, the order for the `defaults` layer is the reverse of what is specified in `theme`.
495
-
For `nav.scss` to find the `brand-blue` variable, `brand` must come after `nav.scss` in `theme`:
496
-
497
-
```{.yaml filename="_quarto.yml"}
498
-
format:
499
-
html:
500
-
theme: [nav.scss, brand]
443
+
$navbar-bg: $brand-blue;
501
444
```
502
445
503
446
### Typst
@@ -520,8 +463,4 @@ Filters and shortcodes can access brand values using the `brand` Lua module.
0 commit comments