Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit df1bcfe

Browse files
author
Svetlana Karslioglu
authored
Add css for cards (#2056)
1 parent 04e1ba9 commit df1bcfe

2 files changed

Lines changed: 78 additions & 6 deletions

File tree

_static/css/custom.css

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/* sphinx-design styles for cards/tabs
2+
*/
3+
4+
:root {
5+
--sd-color-primary: #6c6c6d;
6+
--sd-color-primary-highlight: #f3f4f7;
7+
--sd-color-card-border-hover: #ee4c2c;
8+
--sd-color-card-border: #f3f4f7;
9+
--sd-color-card-background: #f3f4f7;
10+
--sd-color-card-text: inherit;
11+
--sd-color-card-header: transparent;
12+
--sd-color-card-footer: transparent;
13+
--sd-color-tabs-label-active: hsla(231, 99%, 66%, 1);
14+
--sd-color-tabs-label-hover: hsla(231, 99%, 66%, 1);
15+
--sd-color-tabs-label-inactive: hsl(0, 0%, 66%);
16+
--sd-color-tabs-underline-active: hsla(231, 99%, 66%, 1);
17+
--sd-color-tabs-underline-hover: rgba(178, 206, 245, 0.62);
18+
--sd-color-tabs-underline-inactive: transparent;
19+
--sd-color-tabs-overline: rgb(222, 222, 222);
20+
--sd-color-tabs-underline: rgb(222, 222, 222);
21+
}
22+
23+
.sd-card {
24+
position: relative;
25+
background-color: #f3f4f7;
26+
opacity: 0.5;
27+
border-radius: 0px;
28+
width: 30%;
29+
border: none
30+
}
31+
32+
33+
.sd-card-img {
34+
opacity: 0.5;
35+
width: 200px;
36+
padding: 0px;
37+
}
38+
39+
.sd-card-img:hover {
40+
opacity: 1.0;
41+
background-color: #f3f4f7;
42+
}
43+
44+
45+
.sd-card:after {
46+
display: block;
47+
opacity: 1;
48+
content: '';
49+
border-bottom: solid 1px #ee4c2c;
50+
background-color: #fff;
51+
transform: scaleX(0);
52+
transition: transform .250s ease-in-out;
53+
transform-origin: 0% 50%;
54+
}
55+
56+
.sd-card:hover {
57+
background-color: #fff;
58+
opacity: 1;
59+
border-top: 1px solid #f3f4f7;
60+
border-left: 1px solid #f3f4f7;
61+
border-right: 1px solid #f3f4f7;
62+
}
63+
64+
.sd-card:hover:after {
65+
transform: scaleX(1);
66+
}
67+

conf.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
'sphinx.ext.intersphinx',
7272
'sphinx_copybutton',
7373
'sphinx_gallery.gen_gallery',
74+
'sphinx_design'
7475
]
7576

7677
intersphinx_mapping = {
@@ -263,19 +264,23 @@
263264
'Miscellaneous'),
264265
]
265266

267+
html_css_files = [
268+
'https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css',
269+
'css/custom.css'
270+
]
266271

267272
def setup(app):
268273
# NOTE: in Sphinx 1.8+ `html_css_files` is an official configuration value
269274
# and can be moved outside of this function (and the setup(app) function
270275
# can be deleted).
271-
html_css_files = [
272-
'https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css'
273-
]
276+
#html_css_files = [
277+
# 'https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css'
278+
#]
274279
# In Sphinx 1.8 it was renamed to `add_css_file`, 1.7 and prior it is
275280
# `add_stylesheet` (deprecated in 1.8).
276-
add_css = getattr(app, 'add_css_file', app.add_stylesheet)
277-
for css_file in html_css_files:
278-
add_css(css_file)
281+
#add_css = getattr(app, 'add_css_file', app.add_stylesheet)
282+
#for css_file in html_css_files:
283+
# add_css(css_file)
279284

280285
# Custom CSS
281286
# app.add_stylesheet('css/pytorch_theme.css')

0 commit comments

Comments
 (0)