Skip to content

Commit 88b032a

Browse files
committed
Move inline styles to a separate CSS files
Most inline shortcode styles were left alone for now.
1 parent d186308 commit 88b032a

File tree

7 files changed

+56
-8
lines changed

7 files changed

+56
-8
lines changed

assets/css/inline-overrides.css

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* These styles were previously defined inline in the theme as hacks. They
3+
* live here so we know where they came from.
4+
*
5+
* Where necessary, new classes were defined in their place so they don't
6+
* interfere with the new theme CSS. (e.g. .override-sidebar-collapse)
7+
**/
8+
9+
.override-table {
10+
width: 100%;
11+
overflow-x: scroll;
12+
display: block;
13+
}
14+
15+
.override-sidebar-collapse {
16+
max-width: calc(100% + 30px) !important;
17+
flex-wrap: nowrap;
18+
}
19+
20+
#api-component {
21+
max-width: 100%;
22+
}
23+
24+
#consent_blackbar {
25+
position: fixed;
26+
top: 0px;
27+
width: 100%;
28+
}
29+
30+
#navbar-sites-button {
31+
display: flex;
32+
gap: 8px;
33+
align-items: center;
34+
}
35+
36+
#navbarNavScroll {
37+
position: relative;
38+
left: -0px;
39+
flex: 1;
40+
}
41+
42+
.sidenav {
43+
width: 25%;
44+
}

layouts/_default/baseof.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,6 @@
6666
</footer>
6767

6868
{{ partial "scripts.html" . }}
69-
<div id="consent_blackbar" style="position:fixed;top:0px;width:100%"></div>
69+
<div id="consent_blackbar"></div>
7070
</body>
7171
</html>

layouts/_default/docs.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{{ define "main" }}
2-
<div class="row" style="max-width: calc(100% + 30px) !important; flex-wrap: nowrap;">
3-
<nav class="sidenav overflow-auto col-md-3 d-none d-xl-block d-print-none align-top" style="width: 25%;">
2+
<div class="row override-sidebar-collapse">
3+
<nav class="sidenav overflow-auto col-md-3 d-none d-xl-block d-print-none align-top">
44
{{ partial "sidebar.html" . }}
55
</nav>
66

@@ -26,7 +26,7 @@ <h1>{{ .Title }}</h1>
2626
</main>
2727
{{ if and (gt .WordCount 200 ) (.Params.toc) }}
2828
{{ if (add (len (findRE "<h3" .Content)) (len (findRE "<h2" .Content))) }}
29-
<div class="col-md-3 d-none d-xl-block d-print-none nginx-toc align-top" style="width: 25%;">
29+
<div class="col-md-3 d-none d-xl-block d-print-none nginx-toc align-top">
3030
{{ partial "toc.html" . }}
3131
</div>
3232
{{ end }}

layouts/partials/api.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!--Use wide page layout for the API reference pages-->
22
<div class="nginx-docs-api-container">
3-
<div id="api-component" class="content" style="max-width: 100%;">
3+
<div id="api-component" class="content">
44
{{ .Content}}
55
</div>
66
</div>

layouts/partials/header.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
</div>
1515
{{ end }}
1616
{{ if ( in .Site.Params.buildtype "package" ) }}
17-
<div class="navbar-nav-scroll" id="navbarNavScroll" style="position: relative;left: -0px;flex: 1;">
17+
<div class="navbar-nav-scroll" id="navbarNavScroll">
1818
<ul class="navbar-nav flex-row">
1919
<li class="nav-item dropdown active">
2020
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
@@ -33,7 +33,7 @@
3333
}}
3434
<ul class="navbar navbar-nav">
3535
<li class="nav-item-explore active">
36-
<button id="navbar-sites-button" class="button navbar-button" style="display: flex; gap: 8px; align-items: center;">
36+
<button id="navbar-sites-button" class="button navbar-button">
3737
F5 Sites
3838
<i id="navbar-sites-button-icon" class="link-chevron-icon fa-solid fa-chevron-down"></i>
3939
</button>

layouts/partials/styles.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
{{ $css5 := resources.Get "css/highlight.css" }}
66
{{ $css6 := resources.Get "css/coveo.css" }}
77
{{ $css7 := resources.Get "css/v2/style.css" }}
8+
{{ $css8 := resources.Get "css/inline-overrides.css" }}
89

910
<!-- load v2 theme assets -->
1011
<link href="{{ $css7.RelPermalink }}" integrity="{{ $css7.Data.Integrity }}" rel="stylesheet" type="text/css" id="css7"
@@ -51,6 +52,9 @@
5152
{{ $cssF5Hugo := $css4 | minify | fingerprint "sha512"}}
5253
<link href="{{ $cssF5Hugo.RelPermalink }}" rel="stylesheet" type="text/css" id="css4">
5354

55+
{{ $cssOverrides := $css8 | minify | fingerprint "sha512"}}
56+
<link href="{{ $cssOverrides.RelPermalink }}" rel="stylesheet" type="text/css" id="css8">
57+
5458
{{ if fileExists "assets/css/custom.css" }}
5559
{{ $customCSS := resources.Get "css/custom.css" | minify | fingerprint "sha512" }}
5660
<link href="{{ $customCSS.RelPermalink }}" rel="stylesheet" type="text/css">

layouts/shortcodes/table.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
text-align: center;
1313
}
1414
</style>
15-
<div style="width:100%;overflow-x:scroll;display:block;">
15+
<div class="override-table">
1616
{{.Inner}}
1717
</div>

0 commit comments

Comments
 (0)