github.com/imran-kn/cilium-fork@v1.6.9/Documentation/_themes/sphinx_rtd_theme/sass/_theme_rst.sass (about) 1 // ------------------------------------------------------------------------------------------------------------------- 2 // CONTRIBUTORS, PLEASE READ THIS! 3 // ------------------------------------------------------------------------------------------------------------------- 4 // Couple things... 5 // 1. Lots of this @extends from wyrm_core/_type.sass (http://www.github.com/snide/wyrm/. 6 // * Try not to replace any @extends code. It's pretty generic stuff meant to work together. 7 // * That said, know that I'm very unlikely to accept PRs from wyrm just to change style here. 8 // 2. I plan to remove the !importants in here. Part of it is due to lazyness, part to sphinx's fondness for nesting. 9 // 3. Try to use variables from wyrm_core/wy_variables.sass. Notable are... 10 // * $base-line-height // All margins, padding and line-height should use this in .25 increments. 11 // * $text-color, $text-light, $text-dark...etc 12 // * $base-font-family, $custom-font-family, $code-font-family 13 // 4. If you have changes for mobile/tablet, put them at the bottom of the sass file. 14 // -------------------------------------------------------------------------------------------------------------------- 15 16 .rst-content 17 // Sphinx by default applies HxW style attributes to images. This fixes that oversite. 18 img 19 max-width: 100% 20 height: auto !important 21 22 .highlight > pre, .linenodiv > pre 23 line-height: normal 24 25 div.figure 26 margin-bottom: $base-line-height 27 p.caption 28 font-style: italic 29 30 div.figure.align-center 31 text-align: center 32 33 // Usually it's a good idea to give images some space. 34 .section > img, .section > a > img 35 margin-bottom: $base-line-height 36 // Questionable whether this is nice or not. It styles eternal links, but comes with some baggage. 37 // a.reference.external:after 38 // font-family: FontAwesome 39 // content: " \f08e " 40 // color: $text-light 41 // vertical-align: super 42 // font-size: 60% 43 44 // For the most part, its safe to assume that sphinx wants you to use a blockquote as an indent. It gets 45 // used in many different ways, so don't assume you can apply some fancy style, just leave it be. 46 blockquote 47 margin-left: $base-line-height 48 line-height: $base-line-height 49 margin-bottom: $base-line-height 50 .literal-block, pre.literal-block 51 @extend .codeblock 52 // These are the various note pullouts that sphinx applies 53 .note, .attention, .caution, .danger, .error, .hint, .important, .tip, .warning, .seealso, .admonition-todo, .admonition 54 @extend .wy-alert 55 .last 56 margin-bottom: 0 57 .admonition-title 58 @extend .wy-alert-title 59 @extend .fa 60 @extend .fa-exclamation-circle 61 &:before 62 margin-right: 4px 63 .note, .seealso 64 @extend .wy-alert.wy-alert-info 65 .hint, .tip, .important 66 @extend .wy-alert.wy-alert-success 67 .error, .danger 68 @extend .wy-alert.wy-alert-danger 69 .warning, .caution, .attention, .admonition-todo 70 @extend .wy-alert.wy-alert-warning 71 // Some people put tables in notes. Let's give them very basic support. 72 .admonition table 73 border-color: rgba(0,0,0,.1) 74 td, th 75 background: transparent !important 76 border-color: rgba(0,0,0,.1) !important 77 .section ul, .toctree-wrapper ul 78 @extend .wy-plain-list-disc 79 .section ol.loweralpha, .section ol.loweralpha li 80 list-style: lower-alpha 81 .section ol.upperalpha, .section ol.upperalpha li 82 list-style: upper-alpha 83 .section ol, ol.arabic 84 @extend .wy-plain-list-decimal 85 .section ol p, .section ul p 86 margin-bottom: $base-line-height / 2 87 .line-block 88 margin-left: $base-line-height 89 90 // Generics handling of headings and toc stuff. 91 .topic-title 92 font-weight: bold 93 margin-bottom: $base-line-height / 2 94 .toc-backref 95 color: $text-color 96 .align-right 97 float: right 98 margin: 0px 0px $base-line-height $base-line-height 99 .align-left 100 float: left 101 margin: 0px $base-line-height $base-line-height 0px 102 .align-center 103 margin: auto 104 display: block 105 .toctree-wrapper p.caption 106 @extend h2 107 108 // This is the #href that shows up on hover. Sphinx's is terrible so I hack it away. 109 h1, h2, h3, h4, h5, h6, dl dt, p.caption 110 .headerlink 111 display: none 112 visibility: hidden 113 font-size: 14px 114 @extend .fa 115 &:after 116 visibility: visible 117 content: "\f0c1" 118 font-family: FontAwesome 119 display: inline-block 120 &:hover .headerlink 121 display: inline-block 122 123 .centered 124 text-align: center 125 126 // Sidebar content. You'll see at the bottom of this file I change it in mobile. 127 .sidebar 128 float: right 129 width: 40% 130 display: block 131 margin: 0 0 $base-line-height $base-line-height 132 padding: $base-line-height 133 background: $sidebar-background-color 134 border: solid 1px $sidebar-border-color 135 // Sidebar content is usually less relevant, so adjust the margins and sizes. 136 p, ul, dl 137 font-size: 90% 138 .last 139 margin-bottom: 0 140 .sidebar-title 141 display: block 142 font-family: $custom-font-family 143 font-weight: bold 144 background: $table-border-color 145 padding: $base-line-height / 4 $base-line-height / 2 146 margin: -$base-line-height 147 margin-bottom: $base-line-height 148 font-size: 100% 149 // Sphinx can highlight searched text with ?highlighted=searchterm 150 .highlighted 151 background: $highlight-color 152 display: inline-block 153 font-weight: bold 154 padding: 0 $base-line-height / 4 155 156 // These are the little citation links [1] that show up within paragraphs. 157 .footnote-reference, .citation-reference 158 vertical-align: super 159 font-size: 90% 160 161 // Tables! Sphinx LOVES TABLES. Most of wyrm assumes you're only going to use a table as a table 162 // so I have to write a bunch of unique stuff for Sphinx to style them up differently like it's 2003. 163 table.docutils.citation, table.docutils.footnote 164 background: none 165 border: none 166 color: $text-medium 167 td, tr 168 border: none 169 background-color: transparent !important 170 white-space: normal 171 td.label 172 padding-left: 0 173 padding-right: 0 174 vertical-align: top 175 code 176 color: $gray 177 table.docutils 178 @extend .wy-table 179 @extend .wy-table-bordered-all 180 &:not(.field-list) 181 @extend .wy-table-striped 182 // This table is what gets spit out for auto-generated API stuff. I style it smaller bits of padding. 183 table.field-list 184 @extend .wy-table 185 border: none 186 td 187 border: none 188 td > strong 189 display: inline-block 190 .field-name 191 padding-right: 10px 192 text-align: left 193 white-space: nowrap 194 .field-body 195 text-align: left 196 197 // These are the "literals" that get spit out when you mark stuff as ``code`` as your write. 198 tt, code 199 @extend code 200 color: $black 201 padding: 2px 5px 202 big, em 203 font-size: 100% !important 204 line-height: normal 205 206 &.literal 207 color: $text-code-color 208 &.xref, a & 209 font-weight: bold 210 color: $text-codexref-color 211 // If the literal is inside an a tag, let's color it like a link 212 a tt, a code 213 color: $link-color 214 dl 215 margin-bottom: $base-line-height 216 dt 217 font-weight: bold 218 // Most of the content within these dls are one liners, so I halve the normal margins. 219 p, table, ul, ol 220 margin-bottom: $base-line-height / 2 !important 221 // rST seems to want dds to be treated as the browser would, indented. 222 dd 223 margin: 0 0 $base-line-height / 2 $base-line-height 224 // This is what Sphinx spits out for it's autodocs. Depending upon what language the person is referencing 225 // these things usually have a class of "method" or "class" or something similar, but really who knows. 226 // Sphinx doesn't give me a generic class on these, so unfortunately I have to apply it to the root dl. 227 // This makes me terribly unhappy and makes this code very nesty. Unfortunately I've seen hand-written docs 228 // that output similar, but not quite the same nesting so this is really the best we can do. 229 dl:not(.docutils) 230 margin-bottom: $base-line-height 231 // This would be the equivilant of a .. class:: 232 dt 233 display: table 234 margin: $base-line-height / 4 0 235 font-size: 90% 236 line-height: normal 237 background: lighten($class-color, 50%) 238 color: $class-color 239 border-top: solid 3px lighten($class-color, 20%) 240 padding: $base-line-height / 4 241 position: relative 242 &:before 243 color: lighten($class-color, 20%) 244 .headerlink 245 color: $text-color 246 font-size: 100% !important 247 // And this would be the .. method:: 248 dl dt 249 margin-bottom: $base-line-height / 4 250 border: none 251 border-left: solid 3px hsl(0,0%,80%) 252 background: hsl(0,0%,94%) 253 color: $method-color 254 .headerlink 255 color: $headerlink-color 256 font-size: 100% !important 257 dt:first-child 258 margin-top: 0 259 // Since dts get the callout style, we treat this less as callouts. 260 tt, code 261 font-weight: bold 262 &.descname, &.descclassname 263 background-color: transparent 264 border: none 265 padding: 0 266 font-size: 100% !important 267 &.descname 268 font-weight: bold 269 // This is for more advanced parameter control 270 .optional 271 display: inline-block 272 padding: 0 4px 273 color: $black 274 font-weight: bold 275 .property 276 display: inline-block 277 padding-right: 8px 278 // Doc links to sourcecode 279 .viewcode-link, .viewcode-back 280 display: inline-block 281 color: $text-viewcode-color 282 font-size: 80% 283 padding-left: $base-line-height 284 .viewcode-back 285 display: block 286 float: right 287 p.rubric 288 margin-bottom: 12px 289 font-weight: bold 290 //Download link 291 code.download 292 background: inherit 293 padding: inherit 294 font-weight: normal 295 font-family: inherit 296 font-size: inherit 297 color: inherit 298 border: inherit 299 white-space: inherit 300 span:first-child 301 -webkit-font-smoothing: subpixel-antialiased 302 @extend .fa 303 @extend .fa-download 304 &:before 305 margin-right: 4px 306 .guilabel 307 border: 1px solid lighten($guilabel-color, 25%) 308 background: lighten($guilabel-color, 50%) 309 font-size: 80% 310 font-weight: 700 311 border-radius: $base-line-height / 6 312 padding: $base-line-height / 10 $base-line-height / 4 313 margin: auto $base-line-height / 12 314 .versionmodified 315 font-style: italic 316 317 318 // Mobile specific 319 +media($mobile) 320 .rst-content 321 .sidebar 322 width: 100%