Skip to content

Commit 63051c4

Browse files
authored
Removes inline scripts and inline styles in botocore documentation site to make it compatible with the newly added security headers (#3336)
* This change removes the use of inline scripts and styles in the Botocore documentation site to make it compatible with the newly implemented security headers.
1 parent 60a2fc6 commit 63051c4

File tree

8 files changed

+308
-114
lines changed

8 files changed

+308
-114
lines changed

docs/source/_static/css/custom.css

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,37 @@
11
/* Prevents two-dimensional scrolling and content loss. */
2-
h1, code, li {
2+
h1,
3+
code,
4+
li {
35
overflow-wrap: break-word;
46
}
57
/* Provides padding to push down the "breadcrumb" navigation in nested pages. */
6-
.content{
8+
.content {
79
padding: 1em 3em;
810
}
911
/* Improves spacing around custom sidebar section*/
10-
.sidebar-div{
12+
.sidebar-div {
1113
margin: var(--sidebar-caption-space-above) 0 0 0;
12-
padding: var(--sidebar-item-spacing-vertical) var(--sidebar-item-spacing-horizontal);
14+
padding: var(--sidebar-item-spacing-vertical)
15+
var(--sidebar-item-spacing-horizontal);
1316
}
1417
/* Custom sidebar heading text. Example: Feedback Section heading. */
15-
.sidebar-heading{
18+
.sidebar-heading {
1619
color: var(--color-sidebar-caption-text);
1720
font-size: var(--font-size--normal);
1821
font-weight: 700;
1922
}
2023
/* Improves text used in custom sidebar section. Example: Feedback section content.*/
21-
.sidebar-text{
24+
.sidebar-text {
2225
color: var(--color-sidebar-caption-text);
2326
font-size: var(--sidebar-item-font-size);
2427
line-height: 1.4;
2528
}
2629
/* Removes empty space above the sidebar-tree (under "Feedback" section) */
27-
.sidebar-tree{
30+
.sidebar-tree {
2831
margin-top: 0px;
2932
}
3033
/* Adds padding around AWS Logo in the left sidebar. */
31-
.sidebar-logo{
34+
.sidebar-logo {
3235
padding: 20% 15%;
3336
}
3437
/* Hides a div by default. */
@@ -52,7 +55,7 @@ h1, code, li {
5255
visibility: hidden;
5356
}
5457
/* Hides the icon by default and applies relevant styling. */
55-
.nav-close-icon{
58+
.nav-close-icon {
5659
color: var(--color-foreground-secondary);
5760
display: flex;
5861
align-items: center;
@@ -73,24 +76,24 @@ h1, code, li {
7376
}
7477
}
7578
@media (max-width: 82em) {
76-
/* Displays a div on a medium screen. */
79+
/* Displays a div on a medium screen. */
7780
.show-div-md {
7881
display: flex;
7982
}
8083
}
8184
/* Apply furo styled admonition titles for <h3>. */
8285
h3.admonition-title {
83-
position: relative;
84-
margin: 0 -0.5rem 0.5rem;
85-
padding-left: 2.5rem;
86-
padding-right: .5rem;
87-
padding-top: .4rem;
88-
padding-bottom: .4rem;
89-
font-weight: 700;
90-
font-size: 1.5em;
91-
line-height: 1.25;
92-
border-radius: unset;
93-
background-color: var(--color-admonition-title-background);
86+
position: relative;
87+
margin: 0 -0.5rem 0.5rem;
88+
padding-left: 2.5rem;
89+
padding-right: 0.5rem;
90+
padding-top: 0.4rem;
91+
padding-bottom: 0.4rem;
92+
font-weight: 700;
93+
font-size: 1.5em;
94+
line-height: 1.25;
95+
border-radius: unset;
96+
background-color: var(--color-admonition-title-background);
9497
}
9598
/* Apply furo styled admonition icons before <h3>. */
9699
h3.admonition-title::before {
@@ -103,3 +106,7 @@ h3.admonition-title::before {
103106
mask-image: var(--icon-admonition-default);
104107
mask-repeat: no-repeat;
105108
}
109+
/* Hides an element by removing it from the document flow */
110+
.hidden {
111+
display: none;
112+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*This file replaces the style defined in the "_head_css_variables.html"
2+
partial from furo==2022.12.7*/
3+
4+
body {
5+
--color-code-background: #f8f8f8;
6+
--color-code-foreground: black;
7+
}
8+
9+
/* Dark theme styles */
10+
@media not print {
11+
body[data-theme="dark"] {
12+
--color-code-background: #272822;
13+
--color-code-foreground: #f8f8f2;
14+
}
15+
16+
/* For users who prefer dark color scheme */
17+
@media (prefers-color-scheme: dark) {
18+
body:not([data-theme="light"]) {
19+
--color-code-background: #272822;
20+
--color-code-foreground: #f8f8f2;
21+
}
22+
}
23+
}

0 commit comments

Comments
 (0)