Skip to content

Commit 286db40

Browse files
authored
Merge pull request #30123 from sftim/20211017_more_responsive_figure_sizing
Make figure sizing more responsive
2 parents a50554d + dc84f0c commit 286db40

File tree

7 files changed

+48
-10
lines changed

7 files changed

+48
-10
lines changed

assets/scss/_custom.scss

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,3 +679,45 @@ body.td-documentation {
679679
font-size: inherit !important;
680680
}
681681
}
682+
683+
/* Force size constraints on figures */
684+
figure {
685+
&.diagram-small img {
686+
max-height: clamp(20mm,12em,80vh);
687+
margin-left: auto;
688+
margin-right: auto;
689+
display: block;
690+
}
691+
&.diagram-medium img {
692+
max-height: clamp(25mm,20em,80vh);
693+
margin-left: auto;
694+
margin-right: auto;
695+
display: block;
696+
}
697+
&.diagram-large img {
698+
max-width: clamp(0vw, 95vw, 100%);
699+
max-height: calc(80vh - 8rem);
700+
}
701+
}
702+
703+
@media only screen and (min-width: 768px) {
704+
figure {
705+
&.diagram-small, &.diagram-medium {
706+
max-width: 80%;
707+
}
708+
&.diagram-large {
709+
max-width: 100%;
710+
width: 100%;
711+
}
712+
&.diagram-small img {
713+
max-width: clamp(30rem, 45ch, 100mm);
714+
}
715+
&.diagram-medium img {
716+
max-width: clamp(50rem, 20ch, 160mm);
717+
}
718+
&.diagram-large img {
719+
max-width: clamp(25vw, 95vw, 100%);
720+
max-height: calc(100vh - 10rem);
721+
}
722+
}
723+
}

content/en/docs/concepts/overview/components.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,7 @@ When you deploy Kubernetes, you get a cluster.
1919
This document outlines the various components you need to have for
2020
a complete and working Kubernetes cluster.
2121

22-
Here's the diagram of a Kubernetes cluster with all the components tied together.
23-
24-
![Components of Kubernetes](/images/docs/components-of-kubernetes.svg)
25-
26-
22+
{{< figure src="/images/docs/components-of-kubernetes.svg" alt="Components of Kubernetes" caption="The components of a Kubernetes cluster" class="diagram-large" >}}
2723

2824
<!-- body -->
2925
## Control Plane Components

content/en/docs/concepts/scheduling-eviction/scheduling-framework.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ equivalent to "Predicate" and "Scoring" is equivalent to "Priority function".
5252
One plugin may register at multiple extension points to perform more complex or
5353
stateful tasks.
5454

55-
{{< figure src="/images/docs/scheduling-framework-extensions.png" title="scheduling framework extension points" >}}
55+
{{< figure src="/images/docs/scheduling-framework-extensions.png" title="scheduling framework extension points" class="diagram-large">}}
5656

5757
### QueueSort {#queue-sort}
5858

content/en/docs/concepts/security/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ computing approach to security, which is widely regarded as a best practice for
2929
software systems.
3030
{{< /note >}}
3131

32-
{{< figure src="/images/docs/4c.png" title="The 4C's of Cloud Native Security" >}}
32+
{{< figure src="/images/docs/4c.png" title="The 4C's of Cloud Native Security" class="diagram-large" >}}
3333

3434
Each layer of the Cloud Native security model builds upon the next outermost layer.
3535
The Code layer benefits from strong base (Cloud, Cluster, Container) security layers.

content/en/docs/concepts/workloads/pods/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ For example, you might have a container that
112112
acts as a web server for files in a shared volume, and a separate "sidecar" container
113113
that updates those files from a remote source, as in the following diagram:
114114

115-
{{< figure src="/images/docs/pod.svg" alt="example pod diagram" width="50%" >}}
115+
{{< figure src="/images/docs/pod.svg" alt="Pod creation diagram" class="diagram-medium" >}}
116116

117117
Some Pods have {{< glossary_tooltip text="init containers" term_id="init-container" >}} as well as {{< glossary_tooltip text="app containers" term_id="app-container" >}}. Init containers run and complete before the app containers are started.
118118

content/en/docs/concepts/workloads/pods/pod-lifecycle.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ exists. If that Pod is deleted for any reason, and even if an identical replacem
5555
is created, the related thing (a volume, in this example) is also destroyed and
5656
created anew.
5757

58-
{{< figure src="/images/docs/pod.svg" title="Pod diagram" width="50%" >}}
58+
{{< figure src="/images/docs/pod.svg" title="Pod diagram" class="diagram-medium" >}}
5959

6060
*A multi-container Pod that contains a file puller and a
6161
web server that uses a persistent volume for shared storage between the containers.*

content/en/docs/tasks/administer-cluster/nodelocaldns.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Having a local cache will help improve the latency in such scenarios.
4646
This is the path followed by DNS Queries after NodeLocal DNSCache is enabled:
4747

4848

49-
{{< figure src="/images/docs/nodelocaldns.svg" alt="NodeLocal DNSCache flow" title="Nodelocal DNSCache flow" caption="This image shows how NodeLocal DNSCache handles DNS queries." >}}
49+
{{< figure src="/images/docs/nodelocaldns.svg" alt="NodeLocal DNSCache flow" title="Nodelocal DNSCache flow" caption="This image shows how NodeLocal DNSCache handles DNS queries." class="diagram-medium" >}}
5050

5151
## Configuration
5252
{{< note >}} The local listen IP address for NodeLocal DNSCache can be any address that can be guaranteed to not collide with any existing IP in your cluster. It's recommended to use an address with a local scope, per example, from the link-local range 169.254.0.0/16 for IPv4 or from the Unique Local Address range in IPv6 fd00::/8.

0 commit comments

Comments
 (0)