sol2/sass/_theme_rst.sass

227 lines
7.6 KiB
Sass

// -------------------------------------------------------------------------------------------------------------------
// CONTRIBUTORS, PLEASE READ THIS!
// -------------------------------------------------------------------------------------------------------------------
// Couple things...
// 1. Lots of this @extends from wyrm_core/_type.sass (http://www.github.com/snide/wyrm/.
// * Try not to replace any @extends code. It's pretty generic stuff meant to work together.
// * That said, know that I'm very unlikely to accept PRs from wyrm just to change style here.
// 2. I plan to remove the !importants in here. Part of it is due to lazyness, part to sphinx's fondness for nesting.
// 3. Try to use variables from wyrm_core/wy_variables.sass. Notable are...
// * $base-line-height // All margins, padding and line-height should use this in .25 increments.
// * $text-color, $text-light, #text-dark...etc
// * $base-font-family, $custom-font-family, $code-font-family
// 4. If you have changes for mobile/tablet, put them at the bottom of the sass file.
// --------------------------------------------------------------------------------------------------------------------
.rst-content
// Sphinx by default applies HxW style attributes to images. This fixes that oversite.
img
max-width: 100%
height: auto !important
// Usually it's a good idea to give images some space.
.section > img
margin-bottom: $base-line-height
// For the most part, its safe to assume that sphinx wants you to use a blockquote as an indent. It gets
// used in many different ways, so don't assume you can apply some fancy style, just leave it be.
blockquote
margin-left: $base-line-height
line-height: $base-line-height
margin-bottom: $base-line-height
// These are the various note pullouts that sphinx applies
.note, .attention, .caution, .danger, .error, .hint, .important, .tip, .warning
@extend .wy-alert
p.last, p.first
margin-bottom: 0
.admonition-title
font-weight: bold
@extend .icon
@extend .icon-exclamation-sign
&:before
margin-right: 4px
.note
@extend .wy-alert.wy-alert-info
.hint, .tip, .important
@extend .wy-alert.wy-alert-info
.error, .danger
@extend .wy-alert.wy-alert-danger
.warning, .caution, .attention
@extend .wy-alert.wy-alert-warning
.section ul, ul.simple, ul.stimple ul, .toctree-wrapper ul
@extend .wy-plain-list-disc
.section ol, ol.simple, ol.arabic
@extend .wy-plain-list-decimal
// Generics handling of headings and toc stuff.
.topic-title
font-weight: bold
margin-bottom: $base-line-height / 2
.toc-backref
color: $text-color
.align-right
float: right
margin: 0px 0px $base-line-height $base-line-height
.align-left
float: left
margin: 0px $base-line-height $base-line-height 0px
// This is the #href that shows up on hover. Sphinx's is terrible so I hack it away.
h1, h2, h3, h4, h5, h6, dl dt
.headerlink
display: none
visibility: hidden
font-size: 14px
@extend .icon
&:after
visibility: visible
content: "\f0c1"
font-family: fontawesome-webfont
display: inline-block
&:hover .headerlink
display: inline-block
// Sidebar content. You'll see at the bottom of this file I change it in mobile.
.sidebar
float: right
width: 40%
display: block
margin: 0 0 $base-line-height $base-line-height
padding: $base-line-height
background: $table-stripe-color
border: solid 1px $table-border-color
// Sidebar content is usually less relevant, so adjust the margins and sizes.
p, ul, dl
font-size: 90%
.last
margin-bottom: 0
.sidebar-title
display: block
font-family: $custom-font-family
font-weight: bold
background: $table-border-color
padding: $base-line-height / 4 $base-line-height / 2
margin: -$base-line-height
margin-bottom: $base-line-height
font-size: 100%
// Sphinx can highlight searched text with ?highlighted=searchterm
.highlighted
background: $yellow
display: inline-block
font-weight: bold
padding: 0 $base-line-height / 4
// These are the little citation links [1] that show up within paragraphs.
.footnote-reference, .citation-reference
vertical-align: super
font-size: 90%
// Tables! Sphinx LOVES TABLES. Most of wyrm assumes you're only going to use a table as a table
// so I have to write a bunch of unique stuff for Sphinx to style them up differently like it's 2003.
table.docutils.citation, table.docutils.footnote
background: none
border: none
color: $gray-light
td, tr
border: none
background-color: transparent !important
white-space: normal
td.label
padding-left: 0
padding-right: 0
vertical-align: top
table.docutils
@extend .wy-table
@extend .wy-table-bordered-all
&:not(.field-list)
@extend .wy-table-striped
// This table is what gets spit out for auto-generated API stuff. I style it smaller bits of padding.
table.docutils.field-list
@extend .wy-table
border: none
td
border: none
.field-name
padding-right: 5px
text-align: left
.field-body
text-align: left
padding-left: 0
// These are the "literals" that get spit out when you mark stuff as ``code`` as your write.
tt
@extend code
color: $black
big, em
font-size: 100% !important
line-height: normal
.xref, a &
font-weight: bold
// This is what Sphinx spits out for it's autodocs. Depending upon what language the person is referencing
// these things usually have a class of "method" or "class" or something similar, but really who knows.
// Sphinx doesn't give me a generic class on these, so unfortunately I have to apply it to the root dl.
// This makes me terribly unhappy and makes this code very nesty. Unfortunately I've seen hand-written docs
// that output similar, but not quite the same nesting so this is really the best we can do.
dl
// This would be the equivilant of a .. class::
dt
display: inline-block
margin: $base-line-height / 4 0
font-size: 90%
line-height: normal
background: lighten($blue, 50%)
color: $blue
border-top: solid 3px lighten($blue, 20%)
padding: $base-line-height / 4
&:before
color: lighten($blue, 20%)
.headerlink
color: $text-color
font-size: 100% !important
// And this would be the .. method::
dl dt
margin-bottom: $base-line-height / 4
border: none
border-left: solid 3px hsl(0,0%,80%)
background: hsl(0,0%,94%)
color: $text-medium
.headerlink
color: $text-color
font-size: 100% !important
// This is the description for the class/method.
dd
margin-left: $base-line-height
// Most of the content within these dls are one liners, so I halve the normal margins.
p, table, ul, ol
margin-bottom: $base-line-height / 2 !important
dt:first-child
margin-top: 0
// Since dts get the callout style, we treat this less as callouts.
tt
font-weight: bold
&.descname, &.descclassname
background-color: transparent
border: none
padding: 0
font-size: 100% !important
&.descname
font-weight: bold
// This is for more advanced parameter control
.optional
display: inline-block
padding: 0 4px
color: $black
font-weight: bold
.property
display: inline-block
padding-right: 8px
// Mobile specific
+media($mobile)
.rst-content
.sidebar
width: 100%