Skip to content

Commit 3db4e2f

Browse files
authored
Cleanup: Sass formatting (#1119)
* Cleanup: Sass formatting This patch addresses some sass formatting to make the code easier to read: - Use leading zeros on decimals less than 1 - Use parentheses around math for css propeties with multiply arguments - Spaces after commas in arguments In the future it would be nice to automatically format this with a tool like style lint. * Revert Extra Tabbing * Add back missing line * Add whitespace back * Fix whitespace 2
1 parent 2f12da3 commit 3db4e2f

File tree

4 files changed

+43
-43
lines changed

4 files changed

+43
-43
lines changed

src/sass/_theme_badge_fa.sass

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ ul.fas
3030
text-indent: -0.8em
3131
li
3232
.fa
33-
width: .8em
33+
width: 0.8em
3434
.fa-large:before,
3535
.fa-large:before
3636
/* 1.5 increased font size for fa-large * 1.25 width

src/sass/_theme_layout.sass

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ html
1515
ul, li
1616
display: inline-block
1717
li:hover
18-
background: rgba(255,255,255,.1)
18+
background: rgba(255, 255, 255, 0.1)
1919
li
2020
&.divide-left
2121
border-left: solid 1px hsl(0, 0%, 25%)
@@ -35,7 +35,7 @@ html
3535
height: $base-font-size * 2
3636
line-height: $base-font-size * 2
3737
padding: 0 $gutter
38-
margin: $base-line-height / 2 0 0 0
38+
margin: ($base-line-height / 2) 0 0 0
3939
display: block
4040
font-weight: bold
4141
text-transform: uppercase
@@ -54,7 +54,7 @@ html
5454
a
5555
color: $menu-link-medium
5656
border-right: solid 1px darken($menu-vertical-background-color, 20%)
57-
padding: $gutter / 4 $gutter * 1.5
57+
padding: ($gutter / 4) ($gutter * 1.5)
5858
&:hover
5959
background: darken($menu-vertical-background-color, 15%)
6060
code
@@ -76,7 +76,7 @@ html
7676
// On state for the first level
7777
li.on a, li.current > a
7878
color: $menu-link-color
79-
padding: $gutter / 4 $gutter
79+
padding: ($gutter / 4) $gutter
8080
font-weight: bold
8181
position: relative
8282
background: $menu-vertical-background-color
@@ -107,7 +107,7 @@ html
107107
display: block
108108

109109
%shrink_toctree_element
110-
font-size: .9em
110+
font-size: 0.9em
111111

112112
%toctree_link_color
113113
color: $menu-link-color
@@ -128,11 +128,11 @@ html
128128
@extend %toctree_link_color
129129
&.current
130130
> a
131-
padding: $gutter / 4 $gutter * ($toc_level - 1 + .5)
131+
padding: ($gutter / 4) ($gutter * ($toc_level - 1 + 0.5))
132132

133133
li.toctree-l#{$toc_level + 1} > a
134134
@extend %display_current_toctree_element
135-
padding: $gutter / 4 $gutter * ($toc_level + .5)
135+
padding: ($gutter / 4) ($gutter * ($toc_level + 0.5))
136136
padding-right: $gutter
137137
a:hover span.toctree-expand
138138
@extend %toctree_hover_link_color
@@ -168,7 +168,7 @@ html
168168
font-weight: normal
169169
a
170170
line-height: 18px
171-
padding: $gutter / 4 $gutter
171+
padding: ($gutter / 4) $gutter
172172
display: block
173173
position: relative
174174
font-size: 90%
@@ -201,7 +201,7 @@ html
201201
border-color: darken($link-color, 5%)
202202
img
203203
display: block
204-
margin: auto auto $gutter / 2 auto
204+
margin: auto auto ($gutter / 2) auto
205205
height: 45px
206206
width: 45px
207207
background-color: $menu-logo-color
@@ -212,27 +212,27 @@ html
212212
font-size: 100%
213213
font-weight: bold
214214
display: inline-block
215-
padding: $base-line-height / 6 $base-line-height / 4
215+
padding: ($base-line-height / 6) ($base-line-height / 4)
216216
margin-bottom: $gutter / 2
217217
+font-smooth
218218
&:hover
219-
background: rgba(255,255,255,.1)
219+
background: rgba(255, 255, 255, 0.1)
220220
img.logo
221221
display: block // display on its own line all the time
222222
margin: 0 auto
223223
height: auto // undo badge styling above
224224
width: auto
225225
border-radius: 0
226226
max-width: 100% // shrink on mobile, if appropriate
227-
background: rgba(0,0,0,0) // make hover background of parent show up properly
227+
background: rgba(0, 0, 0, 0) // make hover background of parent show up properly
228228
&.icon
229229
img.logo
230230
margin-top: 0.85em // space it away from the title text
231231
> div.version
232-
margin-top: -1 * ($gutter / 4)
232+
margin-top: -1 * $gutter / 4
233233
margin-bottom: $gutter / 2
234234
font-weight: normal
235-
color: rgba(255,255,255,.3)
235+
color: rgba(255, 255, 255, 0.3)
236236

237237
.wy-nav .wy-menu-vertical
238238
header
@@ -244,7 +244,7 @@ html
244244
color: $white
245245

246246
[data-menu-wrap]
247-
+transition(all .2s ease-in)
247+
+transition(all 0.2s ease-in)
248248
position: absolute
249249
opacity: 1
250250
width: 100%
@@ -295,7 +295,7 @@ html
295295
display: none
296296
background: $link-color
297297
color: $white
298-
padding: $gutter / 4 $gutter / 2
298+
padding: ($gutter / 4) ($gutter / 2)
299299
position: relative
300300
line-height: 50px
301301
text-align: center
@@ -324,7 +324,7 @@ html
324324
min-height: 100%
325325

326326
.wy-nav-content
327-
padding: $gutter $gutter * 2
327+
padding: $gutter ($gutter * 2)
328328
height: 100%
329329
max-width: $nav-content-width
330330
margin: auto
@@ -333,7 +333,7 @@ html
333333
position: fixed
334334
width: 100%
335335
height: 100%
336-
background: rgba(0,0,0,.2)
336+
background: rgba(0, 0, 0, 0.2)
337337
display: none
338338
z-index: $z-index-modal - 1
339339
&.on
@@ -411,7 +411,7 @@ footer
411411

412412
@media screen and (min-width: $nav-media-query)
413413
.wy-nav-content-wrap
414-
background: rgba(0,0,0,.05)
414+
background: rgba(0, 0, 0, 0.05)
415415
.wy-nav-content
416416
margin: 0
417417
background: $section-background-color

src/sass/_theme_rst.sass

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
pre.literal-block
5757
white-space: pre
5858
margin: 0
59-
padding: $base-line-height / 2 $base-line-height / 2
59+
padding: ($base-line-height / 2) ($base-line-height / 2)
6060
font-family: $code-font-family
6161
display: block
6262
overflow: auto
@@ -75,21 +75,21 @@
7575
.linenodiv pre
7676
border-right: solid 1px lighten($table-border-color, 2%)
7777
margin: 0
78-
padding: $base-line-height / 2 $base-line-height / 2
78+
padding: ($base-line-height / 2) ($base-line-height / 2)
7979
font-family: $code-font-family
8080
user-select: none
8181
pointer-events: none
8282
div[class^='highlight'] pre
8383
white-space: pre
8484
margin: 0
85-
padding: $base-line-height / 2 $base-line-height / 2
85+
padding: ($base-line-height / 2) ($base-line-height / 2)
8686
display: block
8787
overflow: auto
8888
& .hll
8989
// Line emphasis spans full width
9090
display: block
91-
margin: 0 -1 * $base-line-height / 2
92-
padding: 0 $base-line-height / 2
91+
margin: 0 (-1 * $base-line-height / 2)
92+
padding: 0 ($base-line-height / 2)
9393
pre.literal-block, div[class^='highlight'] pre, .linenodiv pre
9494
font-family: $code-font-family
9595
font-size: 12px
@@ -135,10 +135,10 @@
135135
@extend .wy-alert.wy-alert-warning
136136
// Some people put tables in notes. Let's give them very basic support.
137137
.admonition table
138-
border-color: rgba(0,0,0,.1)
138+
border-color: rgba(0, 0, 0, 0.1)
139139
td, th
140140
background: transparent !important
141-
border-color: rgba(0,0,0,.1) !important
141+
border-color: rgba(0, 0, 0, 0.1) !important
142142
.section ul, .toctree-wrapper ul
143143
@extend .wy-plain-list-disc
144144
.section ol.loweralpha, .section ol.loweralpha > li
@@ -234,14 +234,14 @@
234234
font-family: $custom-font-family
235235
font-weight: bold
236236
background: $table-border-color
237-
padding: $base-line-height / 4 $base-line-height / 2
237+
padding: ($base-line-height / 4) ($base-line-height / 2)
238238
margin: -$base-line-height
239239
margin-bottom: $base-line-height
240240
font-size: 100%
241241
// Sphinx can highlight searched text with ?highlighted=searchterm
242242
.highlighted
243243
background: $highlight-color
244-
box-shadow: 0 0 0 $base-line-height / 12 $highlight-color
244+
box-shadow: 0 0 0 ($base-line-height / 12) $highlight-color
245245
display: inline
246246
font-weight: bold
247247

@@ -289,28 +289,28 @@
289289
> dt, > dd
290290
margin-bottom: 0rem
291291
dl.footnote
292-
font-size: .9rem
292+
font-size: 0.9rem
293293
> dt
294-
margin: 0rem .5rem .5rem 0rem
294+
margin: 0rem 0.5rem 0.5rem 0rem
295295
line-height: 1.2rem
296296
word-break: break-all
297297
font-weight: normal
298298
> span.brackets
299-
margin-right: .5rem
299+
margin-right: 0.5rem
300300
&:before
301301
content: "["
302302
&:after
303303
content: "]"
304304
> span.fn-backref
305305
font-style: italic
306306
> dd
307-
margin: 0rem 0rem .5rem 0rem
307+
margin: 0rem 0rem 0.5rem 0rem
308308
line-height: 1.2rem
309309
p
310-
font-size: .9rem
310+
font-size: 0.9rem
311311
dl.option-list
312312
kbd
313-
font-size: .9rem
313+
font-size: 0.9rem
314314
// Both
315315
html.writer-html4 & table.docutils.citation, table.docutils.footnote,
316316
html.writer-html5 & dl.footnote
@@ -340,7 +340,7 @@
340340
th > p, td > p
341341
line-height: 1rem
342342
margin-bottom: 0rem
343-
font-size: .9rem
343+
font-size: 0.9rem
344344
&:not(.field-list)
345345
@extend .wy-table-striped
346346
// Remove bottom margin for the last element (and it's last child)
@@ -395,14 +395,14 @@
395395
margin-bottom: $base-line-height / 2
396396
// rST seems to want dds to be treated as the browser would, indented.
397397
dd
398-
margin: 0 0 $base-line-height / 2 $base-line-height
398+
margin: 0 0 ($base-line-height / 2) $base-line-height
399399
line-height: $base-line-height
400400
html.writer-html4 & dl:not(.docutils),
401401
html.writer-html5 & dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple)
402402
margin-bottom: $base-line-height
403403
> dt
404404
display: table
405-
margin: $base-line-height / 4 0
405+
margin: ($base-line-height / 4) 0
406406
font-size: 90%
407407
line-height: normal
408408
background: lighten($class-color, 50%)
@@ -420,8 +420,8 @@
420420
dl:not(.field-list) > dt
421421
margin-bottom: $base-line-height / 4
422422
border: none
423-
border-left: solid 3px hsl(0,0%,80%)
424-
background: hsl(0,0%,94%)
423+
border-left: solid 3px hsl(0, 0%, 80%)
424+
background: hsl(0, 0%, 94%)
425425
color: $method-color
426426
.headerlink
427427
color: $headerlink-color
@@ -481,8 +481,8 @@
481481
font-size: 80%
482482
font-weight: 700
483483
border-radius: $base-line-height / 6
484-
padding: $base-line-height / 10 $base-line-height / 4
485-
margin: auto $base-line-height / 12
484+
padding: ($base-line-height / 10) ($base-line-height / 4)
485+
margin: auto ($base-line-height / 12)
486486
.versionmodified
487487
font-style: italic
488488

src/sass/_theme_variables.sass

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ $fa-font-path: "~font-awesome/fonts"
66
$static-img: "../img/"
77

88
$nav-content-width: 800px
9-
$nav-media-query: (($nav-desktop-width) + ($nav-content-width))
9+
$nav-media-query: $nav-desktop-width + $nav-content-width
1010

1111
$mathjax-color: $text-color
1212

0 commit comments

Comments
 (0)