Skip to content

Commit 3187dbe

Browse files
committed
Expand
1 parent 03f7c4c commit 3187dbe

File tree

5 files changed

+96
-71
lines changed

5 files changed

+96
-71
lines changed

docs/authoring/brand.qmd

Lines changed: 96 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -37,36 +37,27 @@ typography:
3737
When this `_brand.yml` is placed in a project, webpages, presentations, PDF reports, and dashboards will share a common appearance:
3838

3939
::::::: {.column-body-outset-right layout-ncol="4"}
40-
<div>
41-
40+
::: {}
4241
![Webpage: `html`](images/brand-html.png){.lightbox group="brand-formats" 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."}
42+
:::
4343

44-
</div>
45-
46-
<div>
47-
44+
::: {}
4845
![Dashboard `dashboard`](images/brand-dashboard.png){.lightbox group="brand-formats" fig-alt="Screenshot of a dashboard. The text is dark grey on a light blue background, using a rounded sans-serif typeface, a logo appears in the navbar."}
46+
:::
4947

50-
</div>
51-
52-
<div>
53-
48+
::: {}
5449
![Presentation: `revealjs`](images/brand-revealjs.png){.lightbox group="brand-formats" fig-alt="Screenshot of a presentation. The text is dark grey on a light blue background, using a rounded sans-serif typeface, a logo appears in bottom left of the slide."}
50+
:::
5551

56-
</div>
57-
58-
<div>
59-
52+
:::{}
6053
![PDF: `typst`](images/brand-typst.png){.lightbox group="brand-formats" fig-alt="Screenshot of a PDF document. The text is dark grey on a light blue background, using a rounded sans-serif typeface, a logo appears in top right of the page."}
54+
:::
55+
:::
6156

62-
</div>
63-
:::::::
6457

65-
::: {.smaller .muted}
6658
You can view the source for the above example and the live website at:
6759

6860
*Move these*
69-
:::
7061

7162
On this page:
7263

@@ -108,39 +99,56 @@ color:
10899
background: blue
109100
```
110101

111-
The semantic colors you can set in `color` are:
112-
113-
+--------------+-------------------------------------------------------------------------------------------------------------------------------+
114-
| Name | Description |
115-
+==============+===============================================================================================================================+
116-
| `foreground` | The main text color. Typically will be close to black and must have high contrast with the background color. |
117-
+--------------+-------------------------------------------------------------------------------------------------------------------------------+
118-
| `background` | The main background color. Tyically will be close to white and must have high contrast with the foreground color. |
119-
+--------------+-------------------------------------------------------------------------------------------------------------------------------+
120-
| `primary` | The primary accent color, used for hyperlinks, active states, and primary action buttons. |
121-
+--------------+-------------------------------------------------------------------------------------------------------------------------------+
122-
| `secondary` | The secondary accent color, often used for lighter text or disabled states. |
123-
+--------------+-------------------------------------------------------------------------------------------------------------------------------+
124-
| `tertiary` | The tertiary accent color, used for hover states, accents, and wells. |
125-
+--------------+-------------------------------------------------------------------------------------------------------------------------------+
126-
| `success` | The color used for positive or successful actions and information. |
127-
+--------------+-------------------------------------------------------------------------------------------------------------------------------+
128-
| `info` | The color used for neutral or informational actions and information. |
129-
+--------------+-------------------------------------------------------------------------------------------------------------------------------+
130-
| `warning` | The color used for warning or cautionary actions and information. |
131-
+--------------+-------------------------------------------------------------------------------------------------------------------------------+
132-
| `danger` | The color used for errors, dangerous actions, or negative information. |
133-
+--------------+-------------------------------------------------------------------------------------------------------------------------------+
134-
| `light` | A bright color, used as a high-contrast foreground color on dark elements or low-contrast background color on light elements. |
135-
+--------------+-------------------------------------------------------------------------------------------------------------------------------+
136-
| `dark` | A dark color, used as a high-contrast foreground color on light elements or high-contrast background color on light elements. |
137-
+--------------+-------------------------------------------------------------------------------------------------------------------------------+
102+
The most commonly set colors include `foreground`, `background` and `primary`:
103+
104+
``` {.yaml filename="_brand.yml"}
105+
color:
106+
palette:
107+
dark-grey: "#222222"
108+
blue: "#ddeaf1"
109+
background: blue
110+
foreground: dark-grey
111+
primary: black
112+
```
138113

139114
The colors `foreground` and `background` are used consistently across formats to set the color of the main text and color of the page it appears on.
115+
The color `primary` sets the link color, navbar color (`html` and `dashboard`), and progress bar color (`revealjs`).
140116

141117
For HTML formats that use Bootstrap (`html`, `dashboard`) the remaining semantic colors are mapped directly to their Bootstrap counterparts with the same name.
142118

143-
For `revealjs` the semantic colors are mapped to the following roles: e.g. `primary` controls the color of links and the progress bar. *Worth doing this? What about for Typst?*
119+
::: {.callout-tip collapse="true"}
120+
121+
## Full list of semantic colors
122+
123+
The full list of semantic colors you can set in `color` is:
124+
125+
+-----------------------+-------------------------------------------------------------------------------------------------------------------------------+
126+
| Name | Description |
127+
+=======================+===============================================================================================================================+
128+
| `foreground` | The main text color. Typically will be close to black and must have high contrast with the background color. |
129+
+-----------------------+-------------------------------------------------------------------------------------------------------------------------------+
130+
| `background` | The main background color. Tyically will be close to white and must have high contrast with the foreground color. |
131+
+-----------------------+-------------------------------------------------------------------------------------------------------------------------------+
132+
| `primary` | The primary accent color, used for hyperlinks, active states, and primary action buttons. |
133+
+-----------------------+-------------------------------------------------------------------------------------------------------------------------------+
134+
| `secondary` | The secondary accent color, often used for lighter text or disabled states. |
135+
+-----------------------+-------------------------------------------------------------------------------------------------------------------------------+
136+
| `tertiary` | The tertiary accent color, used for hover states, accents, and wells. |
137+
+-----------------------+-------------------------------------------------------------------------------------------------------------------------------+
138+
| `success` | The color used for positive or successful actions and information. |
139+
+-----------------------+-------------------------------------------------------------------------------------------------------------------------------+
140+
| `info` | The color used for neutral or informational actions and information. |
141+
+-----------------------+-------------------------------------------------------------------------------------------------------------------------------+
142+
| `warning` | The color used for warning or cautionary actions and information. |
143+
+-----------------------+-------------------------------------------------------------------------------------------------------------------------------+
144+
| `danger` | The color used for errors, dangerous actions, or negative information. |
145+
+-----------------------+-------------------------------------------------------------------------------------------------------------------------------+
146+
| `light` | A bright color, used as a high-contrast foreground color on dark elements or low-contrast background color on light elements. |
147+
+-----------------------+-------------------------------------------------------------------------------------------------------------------------------+
148+
| `dark` | A dark color, used as a high-contrast foreground color on light elements or high-contrast background color on light elements. |
149+
+-----------------------+-------------------------------------------------------------------------------------------------------------------------------+
150+
151+
:::
144152

145153
You can access both named and semantic colors from your brand in SCSS and using the `brand` shortcode. See [Using `_brand.yml` values](#using-brand-values) for more details.
146154

@@ -167,19 +175,19 @@ logo:
167175

168176
You don't need to specify all three—Quarto will use what you provide based on the following preferences:
169177

170-
+----------------+----------------------------------------------+-------------------------------+
171-
| Format | Location | Logo Preference (high to low) |
172-
+================+==============================================+===============================+
173-
| `html` | Top navigation bar | `small`\> `medium`\>`large` |
174-
+----------------+----------------------------------------------+-------------------------------+
175-
| `html` | Side navigation | `medium`\>`small`\>`large` |
176-
+----------------+----------------------------------------------+-------------------------------+
177-
| `dashboard` | | Same as website?? |
178-
+----------------+----------------------------------------------+-------------------------------+
179-
| `typst` | Top left, control with `format: typst: logo` | `medium`\>`small`\>`large` |
180-
+----------------+----------------------------------------------+-------------------------------+
181-
| `revealjs` | Bottom right corner of slides | `medium`\>`small`\>`large` |
182-
+----------------+----------------------------------------------+-------------------------------+
178+
+----------------------+----------------------------------------------+-------------------------------+
179+
| Format | Location | Logo Preference (high to low) |
180+
+======================+==============================================+===============================+
181+
| `html` | Top navigation bar | `small`\> `medium`\>`large` |
182+
+----------------------+----------------------------------------------+-------------------------------+
183+
| `html` | Side navigation | `medium`\>`small`\>`large` |
184+
+----------------------+----------------------------------------------+-------------------------------+
185+
| `dashboard` | | Same as website?? |
186+
+----------------------+----------------------------------------------+-------------------------------+
187+
| `typst` | Top left, control with `format: typst: logo` | `medium`\>`small`\>`large` |
188+
+----------------------+----------------------------------------------+-------------------------------+
189+
| `revealjs` | Bottom right corner of slides | `medium`\>`small`\>`large` |
190+
+----------------------+----------------------------------------------+-------------------------------+
183191

184192
You can also specify named logos under `images` which you can reference in `small`, `medium` and `large`. In particular, this allows you to set alternative text for your logos using `alt`:
185193

@@ -192,11 +200,13 @@ logo:
192200
small: quarto
193201
```
194202

195-
::: callout-warning
203+
::: {.callout-warning}
204+
196205
## Limitation
197206

198207
The **brand.yml** specification allows you to specify a `light` and `dark` version of your logo, but Quarto currently only uses the `light` version.
199-
:::
208+
209+
:::
200210

201211
### Typography
202212

@@ -224,7 +234,22 @@ typography:
224234
headings: Jura
225235
```
226236

227-
The options `base` and `headings` set the typographic style of the main text and headings respectively. The full set of text elements that you can style with `typography` is:
237+
The options `base` and `headings` set the typographic style of the main text and headings respectively.
238+
Use `links` to apply specific styles to links.
239+
The option `monospace` sets the typographic style of code in general, and `monospace-inline` and `monospace-block` can be further used to style code that appears inline and in blocks respectively.
240+
241+
``` {.yaml filename="_brand.yml"}
242+
# More comprehensive example
243+
# inlcude styling code
244+
```
245+
246+
The fields allowed for each element differ, expand the callout below to see what is supported in each field.
247+
248+
::: {.callout-tip collapse="true"}
249+
250+
## Full set of text elements and supported fields.
251+
252+
The full set of text elements that you can style with `typography` is:
228253

229254
+--------------------+--------------------------------------------------------------------------------------------------------+------------------------+
230255
| Attribute | Description | Supported Fields |
@@ -281,17 +306,15 @@ The supported fields are generally described as follows:
281306

282307
- `decoration`: The text decoration, typically used for links. Common values include "underline", "none", or "overline".
283308

284-
``` {.yaml filename="\"_brand.yml"}
285-
# More comphrensive example
286-
```
309+
:::
287310

288311
### Defaults
289312

290313
<https://posit-dev.github.io/brand-yml/brand/defaults.html>
291314

292315
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`.
293316

294-
#### Quarto
317+
#### Quarto
295318

296319
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`:
297320

@@ -342,11 +365,14 @@ meta:
342365
link: https://www.acmecorp.com
343366
```
344367

345-
::: callout-warning
368+
::: {.callout-warning}
369+
346370
## Limitation
347371

348372
Quarto does nothing with `meta` values.
349-
:::
373+
374+
:::
375+
350376

351377
## Using `_brand.yml` values {#using-brand-values}
352378

@@ -355,8 +381,7 @@ Quarto does nothing with `meta` values.
355381
Values from the `_brand.yml` configuration file can be accessed via the `brand` shortcode.
356382

357383
- `{{{< brand color COLOR_NAME >}}}` resolves `COLOR_NAME` to the appropriate color value
358-
- \`{{{< brand logo LOGO_NAME >}}}
359-
- TBD: what should `{{{< brand typography ... >}}}` resolve to?
384+
- `{{{< brand logo LOGO_NAME >}}}`
360385

361386
### In specific formats
362387

@@ -375,4 +400,4 @@ local primary = brand.get_color('primary')
375400

376401
## Comprehensive Example
377402

378-
TBF. Link to posit-wide documentation?
403+
TBD
129 KB
Loading
212 KB
Loading
68.6 KB
Loading
170 KB
Loading

0 commit comments

Comments
 (0)