Skip to content

Commit cc9f9bc

Browse files
Fix grid layout (#475)
1 parent c98ab3b commit cc9f9bc

20 files changed

+1053
-176
lines changed

assets/theme-css/pst-deps/sphinx-design/_badges.scss

Lines changed: 0 additions & 64 deletions
This file was deleted.

assets/theme-css/pst-deps/sphinx-design/_card.scss

Lines changed: 0 additions & 54 deletions
This file was deleted.

assets/theme-css/pst-deps/sphinx-design/_grid.scss

Lines changed: 0 additions & 21 deletions
This file was deleted.

assets/theme-css/pst-deps/sphinx-design/_icons.scss

Lines changed: 0 additions & 26 deletions
This file was deleted.
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
@import "./pst-deps/sphinx-design/badges";
2-
@import "./pst-deps/sphinx-design/card";
3-
@import "./pst-deps/sphinx-design/grid";
4-
@import "./pst-deps/sphinx-design/icons";
5-
@import "./pst-deps/sphinx-design/dropdown";
1+
@import "./sphinx-design/index";
62
@import "./pst/pydata-sphinx-theme";
73
@import "./spht/code";
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Adapted from Bootstrap v5.0.2 (https://getbootstrap.com/)
2+
// Copyright 2011-2019 The Bootstrap Authors
3+
// Copyright 2011-2019 Twitter, Inc.
4+
// Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5+
6+
.sd-badge {
7+
display: inline-block;
8+
padding: 0.35em 0.65em;
9+
font-size: 0.75em;
10+
font-weight: 700;
11+
line-height: 1;
12+
text-align: center;
13+
white-space: nowrap;
14+
vertical-align: baseline;
15+
border-radius: 0.25rem;
16+
17+
// Empty badges collapse automatically
18+
&:empty {
19+
display: none;
20+
}
21+
}
22+
23+
// Remove underline
24+
a.sd-badge {
25+
text-decoration: none;
26+
}
27+
28+
// Quick fix for badges in buttons
29+
.sd-btn .sd-badge {
30+
position: relative;
31+
top: -1px;
32+
}
33+
34+
// note badge colors were removed in v5
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
$borders: (
2+
0: 0,
3+
1: 1px,
4+
2: 2px,
5+
3: 3px,
6+
4: 4px,
7+
5: 5px,
8+
);
9+
10+
@each $name, $value in $borders {
11+
.sd-border-#{$name} {
12+
border: $value solid !important;
13+
}
14+
.sd-border-top-#{$name} {
15+
border-top: $value solid !important;
16+
}
17+
.sd-border-bottom-#{$name} {
18+
border-bottom: $value solid !important;
19+
}
20+
.sd-border-right-#{$name} {
21+
border-right: $value solid !important;
22+
}
23+
.sd-border-left-#{$name} {
24+
border-left: $value solid !important;
25+
}
26+
}
27+
28+
$rounded: (
29+
0: 0,
30+
1: 0.2rem,
31+
2: 0.3rem,
32+
3: 0.5rem,
33+
pill: 50rem,
34+
circle: 50%,
35+
);
36+
37+
@each $name, $value in $rounded {
38+
.sd-rounded-#{$name} {
39+
border-radius: $value !important;
40+
}
41+
}
42+
43+
// shadows
44+
.shadow-none {
45+
box-shadow: none !important;
46+
}
47+
48+
.sd-shadow-sm {
49+
box-shadow: 0 0.125rem 0.25rem var(--sd-color-shadow) !important;
50+
}
51+
52+
.sd-shadow-md {
53+
box-shadow: 0 0.5rem 1rem var(--sd-color-shadow) !important;
54+
}
55+
56+
.sd-shadow-lg {
57+
box-shadow: 0 1rem 3rem var(--sd-color-shadow) !important;
58+
}
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
// Adapted from Bootstrap v5.0.2 (https://getbootstrap.com/)
2+
// Copyright 2011-2019 The Bootstrap Authors
3+
// Copyright 2011-2019 Twitter, Inc.
4+
// Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5+
6+
.sd-btn {
7+
background-color: transparent;
8+
border: 1px solid transparent;
9+
border-radius: 0.25rem;
10+
// color: var(--sd-color-dark);
11+
cursor: pointer;
12+
display: inline-block;
13+
font-weight: 400;
14+
font-size: 1rem;
15+
line-height: 1.5;
16+
padding: 0.375rem 0.75rem;
17+
text-align: center;
18+
text-decoration: none;
19+
transition:
20+
color 0.15s ease-in-out,
21+
background-color 0.15s ease-in-out,
22+
border-color 0.15s ease-in-out,
23+
box-shadow 0.15s ease-in-out;
24+
vertical-align: middle;
25+
user-select: none;
26+
-moz-user-select: none;
27+
-ms-user-select: none;
28+
-webkit-user-select: none;
29+
30+
&:hover {
31+
text-decoration: none;
32+
}
33+
34+
// &:focus {
35+
// box-shadow: 0 0 0 0.2rem rgba(mix($blue, $blue, 15%), .25);
36+
// outline: 0;
37+
// }
38+
39+
// &:visited {
40+
// color: var(--sd-color-dark);
41+
// }
42+
43+
// // override alabaster theme
44+
// &.reference {
45+
// border-bottom: inherit;
46+
// }
47+
// &.reference:hover {
48+
// border-bottom: inherit;
49+
// }
50+
}
51+
52+
@media (prefers-reduced-motion: reduce) {
53+
.sd-btn {
54+
transition: none;
55+
}
56+
}
57+
58+
@each $color, $value in $semantic-colors {
59+
.sd-btn-#{$color},
60+
.sd-btn-outline-#{$color}:hover,
61+
.sd-btn-outline-#{$color}:focus {
62+
color: var(--sd-color-#{$color}-text) !important;
63+
background-color: var(--sd-color-#{$color}) !important;
64+
border-color: var(--sd-color-#{$color}) !important;
65+
border-width: 1px !important;
66+
border-style: solid !important;
67+
}
68+
.sd-btn-#{$color}:hover,
69+
.sd-btn-#{$color}:focus {
70+
color: var(--sd-color-#{$color}-text) !important;
71+
background-color: var(--sd-color-#{$color}-highlight) !important;
72+
border-color: var(--sd-color-#{$color}-highlight) !important;
73+
border-width: 1px !important;
74+
border-style: solid !important;
75+
}
76+
.sd-btn-outline-#{$color} {
77+
color: var(--sd-color-#{$color}) !important;
78+
border-color: var(--sd-color-#{$color}) !important;
79+
border-width: 1px !important;
80+
border-style: solid !important;
81+
}
82+
}
83+
84+
// make parent clickable
85+
.sd-stretched-link::after {
86+
position: absolute;
87+
top: 0;
88+
right: 0;
89+
bottom: 0;
90+
left: 0;
91+
z-index: 1;
92+
content: "";
93+
}
94+
95+
.sd-hide-link-text {
96+
font-size: 0;
97+
}

0 commit comments

Comments
 (0)