Skip to content

Commit 45672ab

Browse files
committed
port code changes
1 parent 12069c6 commit 45672ab

File tree

3 files changed

+47
-46
lines changed

3 files changed

+47
-46
lines changed

modules/styles/blocks/prism/01-prism.styl

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
1-
/**
2-
* prism.js default theme for JavaScript, CSS and HTML
3-
* Based on dabblet (http://dabblet.com)
4-
* @author Lea Verou
5-
*/
6-
7-
code[class*="language-"],
8-
pre[class*="language-"]
9-
color black
1+
pre[class*="language-"],
2+
pre[class*="language-"] > code,
3+
color #d4d4d4
4+
// text-shadow 0 1px white
105
font-family fixed_width_font
116
direction ltr
127
text-align left
138
white-space pre
149
word-spacing normal
1510
tab-size 4
1611
hyphens none
17-
position relative
1812

1913
/*
2014
In epub all code selected? because Calibre applies this style wrong?
@@ -30,23 +24,32 @@ code[class*="language-"]::selection, code[class*="language-"] ::selection
3024
*/
3125

3226
@media print
33-
code[class*="language-"],
34-
pre[class*="language-"]
27+
pre[class*="language-"],
28+
pre[class*="language-"] > code
3529
text-shadow: none
3630

31+
3732
/* Code blocks */
3833
pre[class*="language-"]
39-
padding 1em
34+
padding 0
4035
margin 1.5em 0
4136
overflow auto
37+
background #f7f4f3
4238

43-
pre[class*="language-"]
44-
background: background_blocks
39+
if isRTL
40+
code
41+
unicode-bidi normal
42+
direction unset
4543

4644
/* Inline code */
47-
:not(pre) > code[class*="language-"]
45+
code[class*="language-"]
4846
padding .1em
4947
border-radius .3em
48+
color #313130
49+
background #f7f4f3
50+
51+
.namespace
52+
opacity .7
5053

5154
.token.comment,
5255
.token.prolog,
@@ -103,3 +106,14 @@ pre[class*="language-"]
103106

104107
.token.entity
105108
cursor help
109+
110+
/*********************************************************
111+
* Line highlighting
112+
*/
113+
pre[class*="language-"] > code[class*="language-"]
114+
position relative
115+
z-index 1
116+
117+
.line-highlight.line-highlight
118+
background var(--backgroundPrismLineHighlight)
119+
z-index 0

modules/styles/blocks/prism/03-prism-line-numbers.styl

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
pre.line-numbers
2-
position relative
3-
if isRTL
4-
padding-right 3.8em
5-
else
6-
padding-left 3.8em
72
counter-reset linenumber
3+
display flex
4+
flex-direction row
85

96
.line-numbers .line-numbers-rows
10-
position absolute
117
pointer-events none
12-
top 0
138
font-size 100%
14-
left -3.8em
159
width 3em /* works for line-numbers below 1000 lines */
1610
letter-spacing -1px
1711
border-right 1px solid light_gray_color
Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,35 @@
11
pre[class*="language-"],
22
code[class*="language-"]
3-
font 14px/17px fixed_width_font
3+
font 15px/20px fixed_width_font
44
z-index 0
55
text-shadow none
66
margin 0
77

8+
//- line height must be the same to avoid jumps of svg arrowed illustrations
9+
@media (min-width: largescreen)
10+
font 16px/20px fixed_width_font
11+
12+
code.token
13+
background inherit
14+
padding 0
15+
16+
817
pre[class*="language-"]
9-
position relative
1018
> code.language-markup
1119
color inherit
12-
position relative
1320

1421
> code[class*="language-"]
1522
background none
16-
padding 0
17-
18-
pre.line-numbers
19-
padding-left 3.5em
23+
padding 1em 1em 1em 0.5em
24+
flex-grow 1
2025

21-
// span with line numbers is moved from <code> to the outer <pre>,
22-
// because we need to handle many <code>...</code> inside single <pre>
23-
// (this we need for highlighting *!*...* /!* inline
2426
.line-numbers .line-numbers-rows
25-
left 0
26-
top 0
27-
padding 1em 0
27+
padding 1em 0 .8em
2828
border 0
2929
background #e7e5e3
3030
width auto
3131

32+
3233
.line-numbers .line-numbers-rows:after
3334
width auto
3435
display block
@@ -39,13 +40,5 @@ pre.line-numbers
3940
.line-numbers-rows > span:before,
4041
.line-numbers .line-numbers-rows:after
4142
padding 0 .7em 0 .8em
42-
background #e7e5e3 // #146 https://github.com/iliakan/javascript-nodejs/issues/146#issuecomment-72321753
43+
// background var(--backgroundAlt) // was s#e7e5e3 // #146 https://github.com/iliakan/javascript-nodejs/issues/146#issuecomment-72321753
4344
text-shadow none
44-
45-
/* not sure if larger code is better
46-
@media (min-width: largescreen)
47-
pre[class*="language-"],
48-
code[class*="language-"]
49-
font-size font_size_m
50-
line-height 19px
51-
*/

0 commit comments

Comments
 (0)