Skip to content

Commit

Permalink
Move API docs related CSS to separate file (#476)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisvandenbossche committed Sep 25, 2021
1 parent 501dde2 commit 8fa0080
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 50 deletions.

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions pydata_sphinx_theme/static/webpack-macros.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@

{% macro head_pre_bootstrap() %}
<link href="{{ pathto('_static/css/theme.css', 1) }}" rel="stylesheet">
<link href="{{ pathto('_static/css/index.193492646ce36602d287d5d23c98cd4a.css', 1) }}" rel="stylesheet">
<link href="{{ pathto('_static/css/index.ef515bf865743bbaed9984579188973e.css', 1) }}" rel="stylesheet">
{% endmacro %}

{% macro head_js_preload() %}
<link rel="preload" as="script" href="{{ pathto('_static/js/index.0f3584fff3176fd4ac0e.js', 1) }}">
<link rel="preload" as="script" href="{{ pathto('_static/js/index.9c9e368bceed924a6569.js', 1) }}">
{% endmacro %}

{% macro body_post() %}
<script src="{{ pathto('_static/js/index.0f3584fff3176fd4ac0e.js', 1) }}"></script>
<script src="{{ pathto('_static/js/index.9c9e368bceed924a6569.js', 1) }}"></script>
{% endmacro %}
48 changes: 48 additions & 0 deletions src/scss/_api.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// Style API docs from sphinx' autodoc / autosummary


/**
* Styling for field lists
*/

/* grey highlighting of 'parameter' and 'returns' field */
table.field-list {
border-collapse: separate;
border-spacing: 10px;
margin-left: 1px;

th.field-name {
padding: 1px 8px 1px 5px;
white-space: nowrap;
background-color: rgb(238, 238, 238);
}

/* italic font for parameter types */
td.field-body {
p {
font-style: italic;

> strong {
font-style: normal;
}
}

/* reduced space around parameter description */
blockquote {
border-left: none;
margin: 0em 0em 0.3em;
padding-left: 30px;
}
}
}

/**
* Styling for autosummary tables
*/

.table.autosummary {
// The first column (with the signature) should not wrap
td:first-child {
white-space: nowrap;
}
}
47 changes: 1 addition & 46 deletions src/scss/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ $grid-breakpoints: (
@import './base';
@import './navbar';
@import './admonitions';
@import './api';

// Custom css, TODO: to be refactored in different partials
div.deprecated {
Expand Down Expand Up @@ -67,52 +68,6 @@ span.guilabel {
margin: auto 2px;
}

/**
* Styling for field lists
*/

/* grey highlighting of 'parameter' and 'returns' field */
table.field-list {
border-collapse: separate;
border-spacing: 10px;
margin-left: 1px;

th.field-name {
padding: 1px 8px 1px 5px;
white-space: nowrap;
background-color: rgb(238, 238, 238);
}

/* italic font for parameter types */
td.field-body {
p {
font-style: italic;

> strong {
font-style: normal;
}
}

/* reduced space around parameter description */
blockquote {
border-left: none;
margin: 0em 0em 0.3em;
padding-left: 30px;
}
}
}

/**
* Styling for autosummary tables
*/

.table.autosummary {
// The first column (with the signature) should not wrap
td:first-child {
white-space: nowrap;
}
}

/**
* Footer
*/
Expand Down

0 comments on commit 8fa0080

Please sign in to comment.