Skip to content

Commit 0b00c27

Browse files
committed
Fix a style bug caused by the insertion of the theme-popup div inside font awesome icon <i>
The div is now inserted after the <i>, the text color has also been changed to the foreground color and the "(default)" text that indicates the default theme is now grey to contrast with the theme name Fixes #97
1 parent e958fc8 commit 0b00c27

File tree

4 files changed

+26
-7
lines changed

4 files changed

+26
-7
lines changed

src/theme/book.css

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,8 @@ table td {
249249
right: 15px;
250250
}
251251
.theme-popup {
252-
position: fixed;
253-
left: -40px;
252+
position: relative;
253+
left: 10px;
254254
-webkit-border-radius: 4px;
255255
border-radius: 4px;
256256
font-size: 0.7em;
@@ -357,12 +357,16 @@ table td {
357357
color: #4183c4;
358358
}
359359
.light .theme-popup {
360+
color: #333;
360361
background: #fafafa;
361362
border: 1px solid #ccc;
362363
}
363364
.light .theme-popup .theme:hover {
364365
background-color: #e6e6e6;
365366
}
367+
.light .theme-popup .default {
368+
color: #ccc;
369+
}
366370
.light blockquote {
367371
margin: 20px 0;
368372
padding: 0 20px;
@@ -461,12 +465,16 @@ table td {
461465
color: #2b79a2;
462466
}
463467
.coal .theme-popup {
468+
color: #98a3ad;
464469
background: #141617;
465470
border: 1px solid #43484d;
466471
}
467472
.coal .theme-popup .theme:hover {
468473
background-color: #1f2124;
469474
}
475+
.coal .theme-popup .default {
476+
color: #43484d;
477+
}
470478
.coal blockquote {
471479
margin: 20px 0;
472480
padding: 0 20px;
@@ -565,12 +573,16 @@ table td {
565573
color: #2b79a2;
566574
}
567575
.navy .theme-popup {
576+
color: #bcbdd0;
568577
background: #161923;
569578
border: 1px solid #737480;
570579
}
571580
.navy .theme-popup .theme:hover {
572581
background-color: #282e40;
573582
}
583+
.navy .theme-popup .default {
584+
color: #737480;
585+
}
574586
.navy blockquote {
575587
margin: 20px 0;
576588
padding: 0 20px;
@@ -669,12 +681,16 @@ table td {
669681
color: #2b79a2;
670682
}
671683
.rust .theme-popup {
684+
color: #262625;
672685
background: #e1e1db;
673686
border: 1px solid #b38f6b;
674687
}
675688
.rust .theme-popup .theme:hover {
676689
background-color: #99908a;
677690
}
691+
.rust .theme-popup .default {
692+
color: #737480;
693+
}
678694
.rust blockquote {
679695
margin: 20px 0;
680696
padding: 0 20px;

src/theme/book.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ $( document ).ready(function() {
5757
var wrapper = $("<a class=\"header\">");
5858
wrapper.attr("name", $(this).text());
5959
// Add so that when you click the link actually shows up in the url bar...
60-
wrapper.attr("href", $(location).attr('href') + "#" + $(this).text());
60+
wrapper.attr("href", $(location).attr('href') + "#" + $(this).text());
6161
return wrapper;
6262
});
6363

@@ -105,13 +105,13 @@ $( document ).ready(function() {
105105
$('.theme-popup').remove();
106106
} else {
107107
var popup = $('<div class="theme-popup"></div>')
108-
.append($('<div class="theme" id="light">Light (default)<div>'))
108+
.append($('<div class="theme" id="light">Light <span class="default">(default)</span><div>'))
109109
.append($('<div class="theme" id="rust">Rust</div>'))
110110
.append($('<div class="theme" id="coal">Coal</div>'))
111111
.append($('<div class="theme" id="navy">Navy</div>'));
112112

113113

114-
$(this).append(popup);
114+
popup.insertAfter(this);
115115

116116
$('.theme').click(function(){
117117
var theme = $(this).attr('id');

src/theme/stylus/theme-popup.styl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.theme-popup {
2-
position: fixed
3-
left: -40px
2+
position: relative
3+
left: 10px
44

55
border-radius: 4px
66
font-size: 0.7em

src/theme/stylus/themes/base.styl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,13 @@
6161
}
6262

6363
.theme-popup {
64+
color: $fg
6465
background: $theme-popup-bg
6566
border: 1px solid $theme-popup-border
6667

6768
.theme:hover { background-color: $theme-hover }
69+
70+
.default { color: $icons }
6871
}
6972

7073
blockquote {

0 commit comments

Comments
 (0)