Skip to content
This repository was archived by the owner on Nov 2, 2024. It is now read-only.

Commit 7da715d

Browse files
committed
Fix TwentyTwentyOne theme overriding the overlow-x
The TwentyTwentyOne theme is overriding the overflow-x which is preventing the line-numbers from showing. This specifies the initial setting in a more specific rule for .wp-block-code code Fixes #99
1 parent 8127a56 commit 7da715d

File tree

5 files changed

+160
-155
lines changed

5 files changed

+160
-155
lines changed

assets/prism-a11y-dark.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
pre.wp-block-code code {
88
color: #f8f8f2;
9+
overflow-x: initial;
910
}
1011

1112
code[class*="language-"],

assets/prism-ghcolors.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
pre.wp-block-code code {
77
color: #393A34;
8+
overflow-x: initial;
89
}
910

1011
code[class*="language-"],

assets/prism-nord.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
pre.wp-block-code code {
99
color: #f8f8f2;
10+
overflow-x: initial;
1011
}
1112

1213
code[class*="language-"],

assets/prism-onedark.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
pre.wp-block-code code {
1111
color: #ABB2BF;
12+
overflow-x: initial;
1213
}
1314

1415
code[class*="language-"],

assets/prism.css

Lines changed: 156 additions & 155 deletions
Original file line numberDiff line numberDiff line change
@@ -6,163 +6,164 @@
66

77
.wp-block-code code {
88
color: #f8f8f2;
9+
overflow-x: initial;
910
}
1011

11-
code[class*="language-"],
12-
pre[class*="language-"] {
13-
color: #f8f8f2;
14-
background: none;
15-
font-family: Hack, "Fira Code", Consolas, Menlo, Monaco, "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", "Courier New", Courier, monospace;
16-
text-align: left;
17-
white-space: pre;
18-
word-spacing: normal;
19-
word-break: normal;
20-
word-wrap: normal;
21-
line-height: 1.5;
22-
23-
-moz-tab-size: 4;
24-
-o-tab-size: 4;
25-
tab-size: 4;
26-
27-
-webkit-hyphens: none;
28-
-moz-hyphens: none;
29-
-ms-hyphens: none;
30-
hyphens: none;
31-
}
32-
33-
/* Code blocks */
34-
pre[class*="language-"] {
35-
padding: 1em;
36-
margin: 0.5em auto;
37-
overflow: auto;
38-
border-radius: 0.3em;
39-
}
40-
41-
:not(pre) > code[class*="language-"],
42-
pre[class*="language-"] {
43-
background: #2b2b2b;
44-
}
45-
46-
/* Inline code */
47-
:not(pre) > code[class*="language-"] {
48-
padding: 0.1em;
49-
border-radius: 0.3em;
50-
white-space: normal;
51-
}
52-
53-
.token.comment,
54-
.token.prolog,
55-
.token.doctype,
56-
.token.cdata {
57-
color: #d4d0ab;
58-
}
59-
60-
.token.punctuation {
61-
color: #fefefe;
62-
}
63-
64-
.token.property,
65-
.token.tag,
66-
.token.constant,
67-
.token.symbol,
68-
.token.deleted {
69-
color: #ffa07a;
70-
}
71-
72-
.token.boolean,
73-
.token.number {
74-
color: #00e0e0;
75-
}
76-
77-
.token.selector,
78-
.token.attr-name,
79-
.token.string,
80-
.token.char,
81-
.token.builtin,
82-
.token.inserted {
83-
color: #abe338;
84-
}
85-
86-
.token.operator,
87-
.token.entity,
88-
.token.url,
89-
.language-css .token.string,
90-
.style .token.string,
91-
.token.variable {
92-
color: #00e0e0;
93-
}
94-
95-
.token.atrule,
96-
.token.attr-value,
97-
.token.function {
98-
color: #ffd700;
99-
}
100-
101-
.token.keyword {
102-
color: #00e0e0;
103-
}
104-
105-
.token.regex,
106-
.token.important {
107-
color: #ffd700;
108-
}
109-
110-
.token.important,
111-
.token.bold {
112-
font-weight: bold;
113-
}
114-
115-
.token.italic {
116-
font-style: italic;
117-
}
118-
119-
.token.entity {
120-
cursor: help;
121-
}
122-
123-
@media screen and (-ms-high-contrast: active) {
124-
code[class*="language-"],
125-
pre[class*="language-"] {
126-
color: windowText;
127-
background: window;
128-
}
129-
130-
:not(pre) > code[class*="language-"],
131-
pre[class*="language-"] {
132-
background: window;
133-
}
134-
135-
.token.important {
136-
background: highlight;
137-
color: window;
138-
font-weight: normal;
139-
}
140-
141-
.token.atrule,
142-
.token.attr-value,
143-
.token.function,
144-
.token.keyword,
145-
.token.operator,
146-
.token.selector {
147-
font-weight: bold;
148-
}
149-
150-
.token.attr-value,
151-
.token.comment,
152-
.token.doctype,
153-
.token.function,
154-
.token.keyword,
155-
.token.operator,
156-
.token.property,
157-
.token.string {
158-
color: highlight;
159-
}
160-
161-
.token.attr-value,
162-
.token.url {
163-
font-weight: normal;
164-
}
165-
}
12+
code[class*="language-"],
13+
pre[class*="language-"] {
14+
color: #f8f8f2;
15+
background: none;
16+
font-family: Hack, "Fira Code", Consolas, Menlo, Monaco, "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", "Courier New", Courier, monospace;
17+
text-align: left;
18+
white-space: pre;
19+
word-spacing: normal;
20+
word-break: normal;
21+
word-wrap: normal;
22+
line-height: 1.5;
23+
24+
-moz-tab-size: 4;
25+
-o-tab-size: 4;
26+
tab-size: 4;
27+
28+
-webkit-hyphens: none;
29+
-moz-hyphens: none;
30+
-ms-hyphens: none;
31+
hyphens: none;
32+
}
33+
34+
/* Code blocks */
35+
pre[class*="language-"] {
36+
padding: 1em;
37+
margin: 0.5em auto;
38+
overflow: auto;
39+
border-radius: 0.3em;
40+
}
41+
42+
:not(pre) > code[class*="language-"],
43+
pre[class*="language-"] {
44+
background: #2b2b2b;
45+
}
46+
47+
/* Inline code */
48+
:not(pre) > code[class*="language-"] {
49+
padding: 0.1em;
50+
border-radius: 0.3em;
51+
white-space: normal;
52+
}
53+
54+
.token.comment,
55+
.token.prolog,
56+
.token.doctype,
57+
.token.cdata {
58+
color: #d4d0ab;
59+
}
60+
61+
.token.punctuation {
62+
color: #fefefe;
63+
}
64+
65+
.token.property,
66+
.token.tag,
67+
.token.constant,
68+
.token.symbol,
69+
.token.deleted {
70+
color: #ffa07a;
71+
}
72+
73+
.token.boolean,
74+
.token.number {
75+
color: #00e0e0;
76+
}
77+
78+
.token.selector,
79+
.token.attr-name,
80+
.token.string,
81+
.token.char,
82+
.token.builtin,
83+
.token.inserted {
84+
color: #abe338;
85+
}
86+
87+
.token.operator,
88+
.token.entity,
89+
.token.url,
90+
.language-css .token.string,
91+
.style .token.string,
92+
.token.variable {
93+
color: #00e0e0;
94+
}
95+
96+
.token.atrule,
97+
.token.attr-value,
98+
.token.function {
99+
color: #ffd700;
100+
}
101+
102+
.token.keyword {
103+
color: #00e0e0;
104+
}
105+
106+
.token.regex,
107+
.token.important {
108+
color: #ffd700;
109+
}
110+
111+
.token.important,
112+
.token.bold {
113+
font-weight: bold;
114+
}
115+
116+
.token.italic {
117+
font-style: italic;
118+
}
119+
120+
.token.entity {
121+
cursor: help;
122+
}
123+
124+
@media screen and (-ms-high-contrast: active) {
125+
code[class*="language-"],
126+
pre[class*="language-"] {
127+
color: windowText;
128+
background: window;
129+
}
130+
131+
:not(pre) > code[class*="language-"],
132+
pre[class*="language-"] {
133+
background: window;
134+
}
135+
136+
.token.important {
137+
background: highlight;
138+
color: window;
139+
font-weight: normal;
140+
}
141+
142+
.token.atrule,
143+
.token.attr-value,
144+
.token.function,
145+
.token.keyword,
146+
.token.operator,
147+
.token.selector {
148+
font-weight: bold;
149+
}
150+
151+
.token.attr-value,
152+
.token.comment,
153+
.token.doctype,
154+
.token.function,
155+
.token.keyword,
156+
.token.operator,
157+
.token.property,
158+
.token.string {
159+
color: highlight;
160+
}
161+
162+
.token.attr-value,
163+
.token.url {
164+
font-weight: normal;
165+
}
166+
}
166167

167168

168169
pre.line-numbers {

0 commit comments

Comments
 (0)