Skip to content

Commit 11a0141

Browse files
committed
Responsive: Fix callout handling and default side
Use `minmax` to manage content and side-callout column Remove device specific media queries
1 parent ffecfad commit 11a0141

File tree

5 files changed

+126
-73
lines changed

5 files changed

+126
-73
lines changed

assets/css/v2/style.css

Lines changed: 34 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@
3232
--color-callout-important-primary: 0.36 0 0;
3333
--color-callout-important-shadow: 0.23 0 0 / 7.06%;
3434

35+
/* vars for the primary grid setup */
36+
--grid-sidebar: 24rem;
37+
--grid-content: minmax(36rem, 50rem);
38+
--grid-side-callout: minmax(18rem, 26rem);
39+
--grid-column-gutter: 3.5rem;
40+
3541
--code-copy-icon-height: 1rem;
3642
--code-copy-icon-width: 1rem;
3743
--breadcrumb-max-height: 54px;
@@ -48,18 +54,13 @@
4854
--table-min-column-spacing-wide: 0.75rem;
4955
--table-header-bottom-spacing: 1rem;
5056
--table-line-height: 1px;
51-
--text-content-width-iphone-13: 30rem;
52-
--text-content-width-mbp-14: 40rem;
53-
--text-content-width-mbp-16: 50rem;
54-
--text-content-width-4k-display: 60rem;
5557
--codeblock-comment-diff: 2rem;
5658
--codeblock-comment-space-between: 10px;
5759
--codeblock-horizontal-line-length: 2rem;
5860
--codeblock-horizontal-line-overflow: 0.25rem;
5961
--codeblock-border-thickness: 1px;
6062
--codeblock-code-section-padding-left: 1rem;
6163
--codeblock-line-box-side-length: 4px;
62-
--component-gap: 3.5rem;
6364
--overflow-gutter-extension: 1rem;
6465

6566
--flow-gap: 1rem;
@@ -134,7 +135,7 @@ h6 {
134135

135136
/* header */
136137
p {
137-
font-weight: 400;
138+
font-weight: 350;
138139
}
139140

140141
ul,
@@ -340,6 +341,7 @@ nav {
340341
grid-column: 1 / -1;
341342
}
342343

344+
/* The default main-layout */
343345
.main-layout {
344346
display: grid;
345347
grid-template-columns: 1fr;
@@ -353,10 +355,12 @@ nav {
353355
.text-content {
354356
grid-column: 1 / -1;
355357
display: grid;
356-
grid-template-columns: var(--text-content-width-iphone-13) 1fr;
358+
grid-template-columns: var(--grid-content);
359+
column-gap: var(--grid-column-gutter);
357360
margin-top: 2rem;
358361
grid-auto-rows: max-content;
359-
grid-gap: var(--flow-gap);
362+
row-gap: var(--flow-gap);
363+
justify-content: center;
360364
}
361365

362366
.text-content > :not(.wide) {
@@ -371,33 +375,29 @@ nav {
371375
width: 100%;
372376
}
373377

374-
@media (min-width: 1185px) {
375-
.main-layout {
378+
@media (max-width: 88rem) {
379+
.base-layout {
376380
display: grid;
377-
grid-template-columns: var(--sidebar-width) 1fr;
378-
column-gap: var(--component-gap);
381+
grid-template-rows: repeat(2, auto);
382+
column-gap: var(--grid-column-gutter);
379383
}
380-
}
381-
@media (max-width: 1184px) {
384+
382385
.sidebar-layout {
383386
display: none;
384387
}
385388
}
386389

387-
@media (min-width: 1512px) {
388-
/* Macbook Pro 14 */
390+
@media (min-width: 88em) {
389391
.base-layout {
390392
display: grid;
391393
grid-template-rows: repeat(2, auto);
392-
column-gap: var(--component-gap);
394+
column-gap: var(--grid-column-gutter);
393395
max-width: 100%;
394396
}
395397

396398
.text-content {
397-
grid-template-columns: var(--text-content-width-mbp-14) var(
398-
--side-gutter-width
399-
);
400-
column-gap: var(--component-gap);
399+
grid-template-columns: var(--grid-content) var(--grid-side-callout);
400+
column-gap: var(--grid-column-gutter);
401401
}
402402

403403
.text-content > :not(.wide) {
@@ -407,59 +407,20 @@ nav {
407407
.main-layout {
408408
display: grid;
409409
grid-template-columns: var(--sidebar-width) 1fr;
410-
column-gap: var(--component-gap);
410+
column-gap: var(--grid-column-gutter);
411411
}
412412

413413
.content-layout {
414414
display: grid;
415-
grid-template-columns: var(--text-content-width-mbp-14) var(
416-
--side-gutter-width
417-
);
418-
column-gap: var(--component-gap);
415+
grid-template-columns: var(--grid-content) var(--grid-side-callout);
416+
column-gap: var(--grid-column-gutter);
419417
}
420418

421419
.content-layout .side-gutter {
422420
grid-column-start: 2;
423421
}
424422
}
425423

426-
@media (min-width: 1728px) {
427-
/* Macbook Pro 16 */
428-
.content-layout {
429-
display: grid;
430-
grid-template-columns: var(--text-content-width-mbp-16) var(
431-
--side-gutter-width
432-
);
433-
column-gap: var(--component-gap);
434-
}
435-
436-
.text-content {
437-
grid-template-columns: var(--text-content-width-mbp-16) var(
438-
--side-gutter-width
439-
);
440-
column-gap: var(--component-gap);
441-
align-items: start;
442-
}
443-
}
444-
445-
@media (min-width: 2560px) {
446-
/* 4k Desktop */
447-
.content-layout {
448-
display: grid;
449-
grid-template-columns: var(--text-content-width-4k-display) var(
450-
--side-gutter-width
451-
);
452-
column-gap: var(--component-gap);
453-
}
454-
455-
.text-content {
456-
grid-template-columns: var(--text-content-width-4k-display) var(
457-
--side-gutter-width
458-
);
459-
column-gap: var(--component-gap);
460-
}
461-
}
462-
463424
.list-page {
464425
--flow-gap: .5rem;
465426

@@ -1100,9 +1061,12 @@ blockquote p:last-child {
11001061
margin: 0 auto;
11011062
}
11021063

1103-
blockquote.side-callout {
1104-
grid-column: 2 !important;
1105-
grid-row: span 2;
1064+
/* Maintain the split column for as long as possible */
1065+
@media (min-width: 67rem) {
1066+
blockquote.side-callout {
1067+
grid-column: 2 !important;
1068+
align-self: start;
1069+
}
11061070
}
11071071

11081072
blockquote > div > * {
@@ -1114,6 +1078,10 @@ blockquote ul {
11141078
margin: 0 0 1rem 1rem;
11151079
}
11161080

1081+
li > blockquote {
1082+
margin: var(--flow-gap) 0 0 0;
1083+
}
1084+
11171085
blockquote.call-out {
11181086
padding: 0.5rem;
11191087

exampleSite/content/test-product/call-out/call-out-code-blocks.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,28 @@ weight: 200
66
---
77

88

9-
## Code Block Multi line
9+
## Code Block Multi line with callout
10+
11+
12+
Start the Docker container to connect it to NGINX One. Replace `YOUR_NGINX_ONE_DATA_PLANE_KEY_HERE` with your data plane key and `VERSION_TAG` with the version tag you pulled.
13+
14+
**For NGINX Plus R33 or later**:
15+
16+
- Use the `NGINX_LICENSE_JWT` variable to pass your JWT license. Replace `YOUR_JWT_HERE` with your JWT.
17+
18+
For more details, see About subscription licenses
19+
20+
```sh
21+
sudo docker run \
22+
--env=NGINX_LICENSE_JWT="YOUR_JWT_HERE" \
23+
--env=NGINX_AGENT_SERVER_GRPCPORT=443 \
24+
--env=NGINX_AGENT_SERVER_HOST=agent.connect.nginx.com \
25+
--env=NGINX_AGENT_SERVER_TOKEN="YOUR_NGINX_ONE_DATA_PLANE_KEY_HERE" \
26+
--env=NGINX_AGENT_TLS_ENABLE=true \
27+
--restart=always \
28+
--runtime=runc \
29+
-d private-registry.nginx.com/nginx-plus/agent:<VERSION_TAG>
30+
```
1031

1132
{{<call-out "" "Example:" "" >}}
1233
To start the container with the `debian` image:
@@ -27,12 +48,11 @@ sudo docker run \
2748

2849
## Code Block Single line
2950

30-
{{<call-out "" "Example:" "" >}}
51+
3152
How to read load nginx config
3253

3354
```sh
3455
nginx -s reload
3556
```
3657

37-
{{</call-out>}}
3858

exampleSite/content/test-product/call-out/call-out-code-lists.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,18 @@ weight: 200
2929
- Add a configuration to the config sync group, so all instances inherit it.
3030
- Add the instances in a separate operation.
3131

32-
Your instances should synchronize with your desired configuration within 30 seconds. {{< /note >}}
32+
Your instances should synchronize with your desired configuration within 30 seconds. {{< /note >}}
33+
34+
35+
## Callout within list
36+
37+
1. Open the JSON Web Token file you downloaded from [MyF5](https://my.f5.com/manage/s/subscriptions) and copy its contents.
38+
39+
{{<call-out "tip" "Copying the JWT token" "" >}} Make sure there are **no extra characters or spaces** when copying the contents of the JWT token: they can invalidate the token and cause 401 errors during authentication.{{</call-out>}}
40+
41+
2. Log in to the Docker registry using the contents of the JSON Web Token file:
42+
43+
```bash
44+
docker login private-registry.nginx.com --username=<JWT_CONTENTS> --password=none
45+
```
46+
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
description: Callout - Side
3+
title: Callout - Side
4+
weight: 200
5+
---
6+
7+
## Text is longer than callout
8+
This is some text that should be along the left of the call out.
9+
This assumes the callout text is shorter than the text in the callout.
10+
If the text in the paragraph is shorter than the callout, it's likely
11+
the content needs to be re-written.
12+
13+
{{<call-out "tip side-callout" "Tip for Automated Reporting" >}}
14+
I am some call out text. Look at me go!
15+
{{</call-out>}}
16+
17+
## Text is shorter than callout
18+
19+
This is some text that should be along the left of the call out.
20+
This assumes the callout text is shorter than the text in the callout.
21+
If the text in the paragraph is shorter than the callout, it's likely
22+
the content needs to be re-written.
23+
24+
{{<call-out "tip side-callout" "Tip for Automated Reporting" >}}
25+
I am some call out text. Look at me go!
26+
{{</call-out>}}
27+
28+
## Very long callout with short text
29+
30+
Short Text
31+
32+
{{<call-out "tip side-callout" "Tip for Automated Reporting" >}}
33+
If you add multiple instances to a single config sync group, simultaneously (with automation), follow these steps. Your instances will inherit your desired configuration:
34+
35+
Create a config sync group.
36+
Add a configuration to the config sync group, so all instances inherit it.
37+
Add the instances in a separate operation.
38+
Your instances should synchronize with your desired configuration within 30 seconds.
39+
{{</call-out>}}
40+
41+
42+
## Non-side call out
43+
44+
This is some text that should be along the left of the call out.
45+
This assumes the callout text is shorter than the text in the callout.
46+
If the text in the paragraph is shorter than the callout, it's likely
47+
the content needs to be re-written.
48+
49+
{{<call-out "tip inline-callout" "Tip for Automated Reporting" >}}
50+
I am some call out text. Look at me go!
51+
{{</call-out>}}

layouts/shortcodes/call-out.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
{{ $sideOption := "side-callout" }}
33
{{ $inlineOption := "inline-callout" }}
44

5-
<!-- Add default option for callouts that are "inline" if one is not provided -->
6-
{{ if and (not (strings.Contains $class $inlineOption)) (not (strings.Contains $class $sideOption)) }}
7-
{{ $class = printf "%s %s" $class $inlineOption }}
5+
<!-- Add default option for callouts that are "sideline" if one is not provided -->
6+
{{ if and (not (strings.Contains $class $sideOption)) (not (strings.Contains $class $inlineOption)) }}
7+
{{ $class = printf "%s %s" $class $sideOption }}
88
{{ end }}
99

1010
<!-- Blockquote element with a class that is the first parameter passed to the shortcode -->

0 commit comments

Comments
 (0)