Skip to content

Commit 576de00

Browse files
authored
Format lookandfeel.md - no content changes (#1969)
1 parent a8e0a1a commit 576de00

1 file changed

Lines changed: 76 additions & 24 deletions

File tree

userguide/content/en/docs/adding-content/lookandfeel.md

Lines changed: 76 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@ place them inside your project's `assets/scss/` folder:
4848
[bs_var]: https://github.com/twbs/bootstrap/blob/v5.3.3/scss/_variables.scss
4949

5050
{{% alert title="Tip" %}}
51-
PostCSS (autoprefixing of CSS browser-prefixes) is not enabled when running in server mode (it is a little slow), so Chrome is the recommended choice for development.
51+
52+
PostCSS (autoprefixing of CSS browser-prefixes) is not enabled when running in
53+
server mode (it is a little slow), so Chrome is the recommended choice for
54+
development.
55+
5256
{{% /alert %}}
5357

5458
## Site colors
@@ -87,7 +91,9 @@ Learn how to modify maps, see [Maps and loops] and [Adding theme colors].
8791

8892
## Fonts
8993

90-
The theme uses [Open Sans](https://fonts.google.com/specimen/Open+Sans) as its primary font. To disable Google Fonts and use a system font, set this SCSS variable in `assets/scss/_variables_project.scss`:
94+
The theme uses [Open Sans](https://fonts.google.com/specimen/Open+Sans) as its
95+
primary font. To disable Google Fonts and use a system font, set this SCSS
96+
variable in `assets/scss/_variables_project.scss`:
9197

9298
```scss
9399
$td-enable-google-fonts: false;
@@ -100,20 +106,31 @@ $google_font_name: "Open Sans";
100106
$google_font_family: "Open+Sans:300,300i,400,400i,700,700i";
101107
```
102108

103-
Note that if you decide to go with a font with different weights (in the built-in configuration this is `300` (light), `400` (medium) and `700` (bold)), you also need to adjust the weight related variables, i.e. variables starting with `$font-weight-`.
109+
Note that if you decide to go with a font with different weights (in the
110+
built-in configuration this is `300` (light), `400` (medium) and `700` (bold)),
111+
you also need to adjust the weight related variables, i.e. variables starting
112+
with `$font-weight-`.
104113

105114
## CSS utilities
106115

107-
For documentation of available CSS utility classes, see the [Bootstrap Documentation](https://getbootstrap.com/). This theme adds very little on its own in this area. However, we have added some color state CSS classes that can be useful in a dynamic context:
116+
For documentation of available CSS utility classes, see the [Bootstrap
117+
Documentation](https://getbootstrap.com/). This theme adds very little on its
118+
own in this area. However, we have added some color state CSS classes that can
119+
be useful in a dynamic context:
108120

109121
* `.-bg-<color>`
110122
* `.-text-<color>`
111123

112-
You can use these classes, for example, to style your text in an appropriate color when you don't know if the `primary` color is dark or light, to ensure proper color contrast. They are also useful when you receive the color code as a [shortcode](/docs/adding-content/shortcodes/) parameter.
124+
You can use these classes, for example, to style your text in an appropriate
125+
color when you don't know if the `primary` color is dark or light, to ensure
126+
proper color contrast. They are also useful when you receive the color code as a
127+
[shortcode](/docs/adding-content/shortcodes/) parameter.
113128

114-
The value of `<color>` can be any of the color names, `primary`, `white`, `dark`, `warning`, `light`, `success`, `300`, `blue`, `orange` etc.
129+
The value of `<color>` can be any of the color names, `primary`, `white`,
130+
`dark`, `warning`, `light`, `success`, `300`, `blue`, `orange` etc.
115131

116-
When you use `.-bg-<color>`, the text colors will be adjusted to get proper contrast:
132+
When you use `.-bg-<color>`, the text colors will be adjusted to get proper
133+
contrast:
117134

118135
```html
119136
<div class="-bg-primary p-3 display-4">Background: Primary</div>
@@ -133,7 +150,13 @@ When you use `.-bg-<color>`, the text colors will be adjusted to get proper cont
133150

134151
## Code highlighting with Chroma
135152

136-
With Hugo version 0.60 and higher, you can choose from a range of code block highlight and colour styles using [Chroma](https://github.com/alecthomas/chroma) that are applied to your fenced code blocks by default. If you copied a recent `hugo.toml` your site uses Tango (like this site), otherwise the Hugo default is Monokai. You can switch to any of the [available Chroma styles](https://xyproto.github.io/splash/docs/all.html) (including our Docsy default Tango) using your `hugo.toml`/`hugo.yaml`/`hugo.json`:
153+
With Hugo version 0.60 and higher, you can choose from a range of code block
154+
highlight and colour styles using [Chroma](https://github.com/alecthomas/chroma)
155+
that are applied to your fenced code blocks by default. If you copied a recent
156+
`hugo.toml` your site uses Tango (like this site), otherwise the Hugo default is
157+
Monokai. You can switch to any of the [available Chroma
158+
styles](https://xyproto.github.io/splash/docs/all.html) (including our Docsy
159+
default Tango) using your `hugo.toml`/`hugo.yaml`/`hugo.json`:
137160

138161
{{< tabpane >}}
139162
{{< tab header="Configuration file:" disabled=true />}}
@@ -170,7 +193,11 @@ markup:
170193
{{< /tab >}}
171194
{{< /tabpane >}}
172195

173-
By default code highlighting styles are not applied to code blocks without a specified language, instead you get Docsy's default style of grey with black text. If you would like the code highlighting style to apply to all code blocks, even without a language, uncomment or add the following line under `[markup.highlight]` in your `hugo.toml`/`hugo.yaml`/`hugo.json`.
196+
By default code highlighting styles are not applied to code blocks without a
197+
specified language, instead you get Docsy's default style of grey with black
198+
text. If you would like the code highlighting style to apply to all code blocks,
199+
even without a language, uncomment or add the following line under
200+
`[markup.highlight]` in your `hugo.toml`/`hugo.yaml`/`hugo.json`.
174201

175202
{{< tabpane >}}
176203
{{< tab header="Configuration file:" disabled=true />}}
@@ -191,11 +218,13 @@ If you are using a Docsy version later than `0.6.0`, the code blocks show a
191218
functionality set `disable_click2copy_chroma` to `true` in your configuration
192219
file:
193220

194-
You can find out more about code highlighting in Hugo with Chroma in [Syntax Highlighting](https://gohugo.io/content-management/syntax-highlighting/).
221+
You can find out more about code highlighting in Hugo with Chroma in [Syntax
222+
Highlighting](https://gohugo.io/content-management/syntax-highlighting/).
195223

196224
## Code highlighting with Prism
197225

198-
Optionally, you can enable Prism syntax highlighting in your `hugo.toml`/`hugo.yaml`/`hugo.json`:
226+
Optionally, you can enable Prism syntax highlighting in your
227+
`hugo.toml`/`hugo.yaml`/`hugo.json`:
199228

200229
{{< tabpane >}}
201230
{{< tab header="Configuration file:" disabled=true />}}
@@ -217,25 +246,37 @@ params:
217246
{{< /tab >}}
218247
{{< /tabpane >}}
219248

220-
When this option is enabled your site uses [Prism](https://prismjs.com/index.html) instead of Chroma for code block highlighting.
249+
When this option is enabled your site uses
250+
[Prism](https://prismjs.com/index.html) instead of Chroma for code block
251+
highlighting.
221252

222-
Prism is a popular open source syntax highlighter which supports over 200 [languages](https://prismjs.com/index.html#supported-languages) and various [plugins](https://prismjs.com/index.html#plugins).
253+
Prism is a popular open source syntax highlighter which supports over 200
254+
[languages](https://prismjs.com/index.html#supported-languages) and various
255+
[plugins](https://prismjs.com/index.html#plugins).
223256

224-
Docsy includes JavaScript and CSS files for a basic Prism configuration, which supports:
257+
Docsy includes JavaScript and CSS files for a basic Prism configuration, which
258+
supports:
225259

226260
* Code blocks styled with the Prism `Default` theme
227261
* Copy to clipboard buttons on code blocks
228-
* Syntax highlighting for a number of common languages, as specified in the following Prism download link, [Customize your download][prismjs-download+].
262+
* Syntax highlighting for a number of common languages, as specified in the
263+
following Prism download link, [Customize your download][prismjs-download+].
229264

230265
[prismjs-download+]: https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript+bash+c+csharp+cpp+go+java+markdown+python+scss+sql+toml+yaml&plugins=toolbar+copy-to-clipboard
231266

232267
### Code blocks with no language
233268

234-
By default, Prism code highlighting styles are not applied to code blocks without a specified language, instead you get Docsy's default style of grey with black text. To apply Prism styling to code blocks with no language or a language not supported by Prism, specify `none` as the language after your triple backticks.
269+
By default, Prism code highlighting styles are not applied to code blocks
270+
without a specified language, instead you get Docsy's default style of grey with
271+
black text. To apply Prism styling to code blocks with no language or a language
272+
not supported by Prism, specify `none` as the language after your triple
273+
backticks.
235274

236275
### Extending Prism for additional languages or plugins
237276

238-
If the included Prism configuration is not sufficient for your requirements, and you want to use additional languages or plugins you can replace the included files with your own.
277+
If the included Prism configuration is not sufficient for your requirements, and
278+
you want to use additional languages or plugins you can replace the included
279+
files with your own.
239280

240281
1. Download your own Prism JS and CSS files from <https://prismjs.com/download.html>
241282
2. Replace the included Prism JS and CSS with the files you downloaded:
@@ -343,8 +384,9 @@ Docsy applies the following styles to all tables, through the class `.td-table`:
343384
- `display: block`, which is necessary for tables to be responsive.
344385

345386
This styling configuration gives you responsive tables using Markdown only,
346-
without the need to wrap the table in a `<div>`. It does, however, mean that all your tables have `display`
347-
set to `block`. If you don't want this, you can create your own custom styles for tables.
387+
without the need to wrap the table in a `<div>`. It does, however, mean that all
388+
your tables have `display` set to `block`. If you don't want this, you can
389+
create your own custom styles for tables.
348390

349391
{{% alert title="Note" %}}
350392

@@ -385,24 +427,34 @@ The example above uses [Markdown attribute][] syntax, and might render like this
385427

386428
### Add code to head or before body end
387429

388-
If you need to add some code (CSS import, cookie consent, or similar) to the `head` section on every page, add the `head-end.html` partial to your project:
430+
If you need to add some code (CSS import, cookie consent, or similar) to the
431+
`head` section on every page, add the `head-end.html` partial to your project:
389432

390433
```
391434
layouts/partials/hooks/head-end.html
392435
```
393436

394-
And add the code you need in that file. Your partial code is automatically included just before the end of the theme partial [`head.html`](https://github.com/google/docsy/blob/main/layouts/partials/head.html). The theme version of [`head-end.html`](https://github.com/google/docsy/blob/main/layouts/partials/hooks/head-end.html) is empty.
437+
And add the code you need in that file. Your partial code is automatically
438+
included just before the end of the theme partial
439+
[`head.html`](https://github.com/google/docsy/blob/main/layouts/partials/head.html).
440+
The theme version of
441+
[`head-end.html`](https://github.com/google/docsy/blob/main/layouts/partials/hooks/head-end.html)
442+
is empty.
395443

396444

397-
Similarly, if you want to add some code right before the `body` end, create your own version of the following file:
445+
Similarly, if you want to add some code right before the `body` end, create your
446+
own version of the following file:
398447

399448
```
400449
layouts/partials/hooks/body-end.html
401450
```
402451

403-
Any code in this file is included automatically at the end of the theme partial [`scripts.html`](https://github.com/google/docsy/blob/main/layouts/partials/head.html).
452+
Any code in this file is included automatically at the end of the theme partial
453+
[`scripts.html`](https://github.com/google/docsy/blob/main/layouts/partials/head.html).
404454

405-
Both `head.html` and `scripts.html` are then used to build Docsy's [base page layout](https://github.com/google/docsy/blob/main/layouts/_default/baseof.html), which is used by all the other page templates:
455+
Both `head.html` and `scripts.html` are then used to build Docsy's [base page
456+
layout](https://github.com/google/docsy/blob/main/layouts/_default/baseof.html),
457+
which is used by all the other page templates:
406458

407459
```html
408460
<!doctype html>

0 commit comments

Comments
 (0)