@@ -18,6 +18,8 @@ On this page:
1818
1919- See a more comprehensive example.
2020
21+ - Learn how to migrate projects created without ` _brand.yml ` to easily support ` _brand.yml ` features.
22+
2123::: callout-warning
2224## Limitation
2325
@@ -510,3 +512,48 @@ Filters and shortcodes can access brand values using the `brand` Lua module.
510512local brand = require (' modules/brand/brand' )
511513local primary = brand .get_color (' primary' )
512514```
515+
516+ ## Migrating to ` _brand.yml ` : use the ` brand ` string in ` theme `
517+
518+ ::: callout-note
519+
520+ The following information is only necessary if you are migrating projects created with Quarto 1.5 and earlier to use ` _brand.yml ` .
521+
522+ :::
523+
524+ Migrating existing projects to Quarto 1.6's ` _brand.yml ` support is a straightforward process.
525+ The usual way to create themes in Quarto 1.5 and earlier is to use one of the predefined bootswatch themes.
526+ This is often combined with an additional user-defined ` .scss ` file.
527+ In Quarto 1.5, a ` _quarto.yml ` file usually has an entry like the following:
528+
529+ ``` yaml
530+ # Quarto 1.5 syntax
531+ theme :
532+ - cosmo # a predefined bootswatch theme
533+ - tweaks.scss # a user-defined customization
534+ ` ` `
535+
536+ When using this syntax with Quarto 1.6's ` _brand.yml` support, keep in mind that `_brand.yml` always takes _lowest_ priority in styles.
537+ In other words, the configuration above is equivalent to the following :
538+
539+ ` ` ` yaml
540+ # Quarto 1.6 syntax
541+ theme:
542+ - brand # theming derived from ` _brand.yml`
543+ - cosmo # a predefined bootswatch theme
544+ - tweaks.scss # a user-defined customization
545+ ` ` `
546+
547+ As a result, values set by ` brand` here are potentially overriden by the `cosmo` theme or by `tweaks.scss`.
548+ This is sometimes useful, but often you will want to make `brand` _more_ important than the theme.
549+ For these situations, use the following :
550+
551+ ` ` ` yaml
552+ # Quarto 1.6 syntax
553+ theme:
554+ - cosmo # a predefined bootswatch theme
555+ - brand # theming derived from ` _brand.yml`
556+ - tweaks.scss # a user-defined customization
557+ ` ` `
558+
559+ Learn more about how Quarto generates styles in [More About Quarto Themes](/docs/output-formats/html-themes-more.qmd).
0 commit comments