Skip to content

Commit 9e1a118

Browse files
authored
Merge pull request #51600 from xirehat/kubernetes-website-rtl-support
Add RTL support
2 parents 1a3ad75 + 485b0a5 commit 9e1a118

File tree

6 files changed

+41
-6
lines changed

6 files changed

+41
-6
lines changed

assets/scss/_desktop.scss

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,19 @@ $vendor-strip-height: 44px;
33

44
@media screen and (min-width: 1024px) {
55

6+
body:dir(rtl) {
7+
overflow-x: hidden;
8+
}
9+
10+
table:dir(rtl) {
11+
text-align: right;
12+
direction: rtl;
13+
}
14+
15+
.breadcrumb-item:dir(rtl) + .breadcrumb-item:dir(rtl)::before {
16+
float: right;
17+
}
18+
619
.td-home {
720
.header-hero {
821
#vendorStrip {
@@ -34,6 +47,9 @@ $vendor-strip-height: 44px;
3447
p {
3548
text-align: left
3649
}
50+
p:dir(rtl) {
51+
text-align: right
52+
}
3753

3854
.image-wrapper {
3955
position: absolute;

assets/scss/_documentation.scss

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,20 @@ div.feature-state-notice {
9090

9191
// All callout headings should be bold
9292
.alert {
93-
border-style: solid;
94-
border-width: 0 0 0 4px;
95-
border-radius: 0 0 2rem 0;
9693
h4 {
9794
font-weight: bold;
9895
font-style: initial;
9996
}
10097
}
98+
.alert:dir(ltr) {
99+
// color the left border (left-to-right locales)
100+
border-width: 0 0 0 4px;
101+
}
102+
103+
.alert:dir(rtl) {
104+
// color the right border (right-to-left locales)
105+
border-width: 0 4px 0 0;
106+
}
101107

102108
.glossary-tooltip {
103109
display: inline-block;

assets/scss/_tablet.scss

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@ $vendor-strip-font-size: 16px;
1818
display: none;
1919
}
2020

21+
body:dir(rtl) {
22+
overflow-x: hidden;
23+
}
24+
25+
table:dir(rtl) {
26+
text-align: right;
27+
direction: rtl;
28+
}
29+
2130
.td-home {
2231
#viewDocs,
2332
#tryKubernetes {
@@ -118,6 +127,10 @@ $vendor-strip-font-size: 16px;
118127
text-align: left;
119128
margin: 0 5% 15px 0;
120129
}
130+
131+
&:dir(rtl) > .light-text {
132+
text-align: right;
133+
}
121134
}
122135

123136
#mobileShowVideoButton {

layouts/_default/baseof.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!doctype html>
2-
<html lang="{{ .Site.Language.Lang }}" class="{{.Params.class}} no-js">
2+
<html lang="{{ .Site.Language.Lang }}" class="{{.Params.class}} no-js" dir="{{ or .Site.Language.LanguageDirection `ltr` }}">
33
{{- if eq hugo.Environment "preview" -}}
44
<!-- deploy preview -->
55
{{- end -}}

layouts/blog/baseof.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!doctype html>
2-
<html lang="{{ .Site.Language.Lang }}" class="no-js">
2+
<html lang="{{ .Site.Language.Lang }}" class="no-js" dir="{{ or .Site.Language.LanguageDirection `ltr` }}">
33
<head>
44
{{ with .Params.canonicalUrl }}
55
<link rel="canonical" href="{{ . }}">

layouts/docs/baseof.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!doctype html>
2-
<html lang="{{ .Site.Language.Lang }}" class="no-js">
2+
<html lang="{{ .Site.Language.Lang }}" class="no-js" dir="{{ or .Site.Language.LanguageDirection `ltr` }}">
33
<head>
44
{{ partial "head.html" . }}
55
<title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} | {{ end }}{{ .Site.Title }}{{ end }}</title>

0 commit comments

Comments
 (0)