Skip to content

Commit 4fedc74

Browse files
committed
Remove includes/assets from build exclusions, add phpcs:ignore comments for prefixed hooks and functions, update toolbar button styles for better contrast, refactor theme CSS path handling in Styles_Handler, inject Prism theme into block editor canvas, update build:prism script to run build-assets, and bump tested-up-to version to 6.9
1 parent 419d4d2 commit 4fedc74

49 files changed

Lines changed: 3759 additions & 44 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

build-assets.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ const config = {
4646
'includes/frontend/blocks',
4747
'includes/pro/blocks',
4848
'includes/build',
49-
'includes/assets',
5049
'includes/frontend/js',
5150
],
5251

includes/admin/class-settings-wizard.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public function get_wizard_steps() {
114114
*
115115
* @param array $steps Wizard steps.
116116
*/
117-
return apply_filters( 'wz_cbh_wizard_steps', $steps );
117+
return apply_filters( 'wz_cbh_wizard_steps', $steps ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
118118
}
119119

120120
/**

includes/admin/class-settings.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ public static function get_registered_settings(): array {
177177
array(
178178
'id' => 'color-scheme',
179179
'name' => __( 'Color Scheme', 'webberzone-code-block-highlighting' ),
180-
'desc' => __( 'Select the syntax highlighting color scheme applied to all code blocks.', 'webberzone-code-block-highlighting' ),
180+
'desc' => __( 'Choose the syntax highlighting theme for all code blocks. This styling is applied only on the frontend and not in the block editor.', 'webberzone-code-block-highlighting' ),
181181
'type' => 'select',
182182
'default' => 'prism-onedark',
183183
'options' => self::$color_schemes,
@@ -285,7 +285,10 @@ public function enqueue_language_data( string $hook ): void {
285285
/**
286286
* Get the URL (or filesystem path) to the active color scheme CSS file.
287287
*
288-
* Falls back to the default A11y Dark theme if the chosen file does not exist.
288+
* Returns the plain unminified LTR path. Frontend enqueuing (with SCRIPT_DEBUG
289+
* and RTL awareness) is handled by Styles_Handler.
290+
*
291+
* Falls back to the default One Dark theme if the chosen file does not exist.
289292
*
290293
* @since 1.0.0
291294
*
@@ -311,6 +314,6 @@ public static function get_color_scheme_css( bool $return_path = false ): string
311314
*
312315
* @param string $url Absolute URL of the CSS file to enqueue.
313316
*/
314-
return apply_filters( 'wz_cbh_color_scheme_css_url', WZ_CBH_PLUGIN_URL . $rel_path );
317+
return apply_filters( 'wz_cbh_color_scheme_css_url', WZ_CBH_PLUGIN_URL . $rel_path ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
315318
}
316319
}
Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
/**
2+
* a11y-dark theme for JavaScript, CSS, and HTML
3+
* Based on the okaidia theme: https://github.com/PrismJS/prism/blob/gh-pages/themes/prism-okaidia.css
4+
* @author ericwbailey
5+
*/
6+
7+
code[class*="language-"],
8+
pre[class*="language-"] {
9+
color: #f8f8f2;
10+
background: none;
11+
font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
12+
text-align: right;
13+
white-space: pre;
14+
word-spacing: normal;
15+
word-break: normal;
16+
word-wrap: normal;
17+
line-height: 1.5;
18+
19+
-moz-tab-size: 4;
20+
-o-tab-size: 4;
21+
tab-size: 4;
22+
23+
-webkit-hyphens: none;
24+
-moz-hyphens: none;
25+
-ms-hyphens: none;
26+
hyphens: none;
27+
}
28+
29+
/* Code blocks */
30+
pre[class*="language-"] {
31+
padding: 1em;
32+
margin: 0.5em 0;
33+
overflow: auto;
34+
border-radius: 0.3em;
35+
}
36+
37+
:not(pre) > code[class*="language-"],
38+
pre[class*="language-"] {
39+
background: #2b2b2b;
40+
}
41+
42+
/* Inline code */
43+
:not(pre) > code[class*="language-"] {
44+
padding: 0.1em;
45+
border-radius: 0.3em;
46+
white-space: normal;
47+
}
48+
49+
.token.comment,
50+
.token.prolog,
51+
.token.doctype,
52+
.token.cdata {
53+
color: #d4d0ab;
54+
}
55+
56+
.token.punctuation {
57+
color: #fefefe;
58+
}
59+
60+
.token.property,
61+
.token.tag,
62+
.token.constant,
63+
.token.symbol,
64+
.token.deleted {
65+
color: #ffa07a;
66+
}
67+
68+
.token.boolean,
69+
.token.number {
70+
color: #00e0e0;
71+
}
72+
73+
.token.selector,
74+
.token.attr-name,
75+
.token.string,
76+
.token.char,
77+
.token.builtin,
78+
.token.inserted {
79+
color: #abe338;
80+
}
81+
82+
.token.operator,
83+
.token.entity,
84+
.token.url,
85+
.language-css .token.string,
86+
.style .token.string,
87+
.token.variable {
88+
color: #00e0e0;
89+
}
90+
91+
.token.atrule,
92+
.token.attr-value,
93+
.token.function {
94+
color: #ffd700;
95+
}
96+
97+
.token.keyword {
98+
color: #00e0e0;
99+
}
100+
101+
.token.regex,
102+
.token.important {
103+
color: #ffd700;
104+
}
105+
106+
.token.important,
107+
.token.bold {
108+
font-weight: bold;
109+
}
110+
111+
.token.italic {
112+
font-style: italic;
113+
}
114+
115+
.token.entity {
116+
cursor: help;
117+
}
118+
119+
@media screen and (-ms-high-contrast: active) {
120+
code[class*="language-"],
121+
pre[class*="language-"] {
122+
color: windowText;
123+
background: window;
124+
}
125+
126+
:not(pre) > code[class*="language-"],
127+
pre[class*="language-"] {
128+
background: window;
129+
}
130+
131+
.token.important {
132+
background: highlight;
133+
color: window;
134+
font-weight: normal;
135+
}
136+
137+
.token.atrule,
138+
.token.attr-value,
139+
.token.function,
140+
.token.keyword,
141+
.token.operator,
142+
.token.selector {
143+
font-weight: bold;
144+
}
145+
146+
.token.attr-value,
147+
.token.comment,
148+
.token.doctype,
149+
.token.function,
150+
.token.keyword,
151+
.token.operator,
152+
.token.property,
153+
.token.string {
154+
color: highlight;
155+
}
156+
157+
.token.attr-value,
158+
.token.url {
159+
font-weight: normal;
160+
}
161+
}

includes/assets/prism-a11y-dark.min.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
/**
2+
* atom-dark theme for `prism.js`
3+
* Based on Atom's `atom-dark` theme: https://github.com/atom/atom-dark-syntax
4+
* @author Joe Gibson (@gibsjose)
5+
*/
6+
7+
code[class*="language-"],
8+
pre[class*="language-"] {
9+
color: #c5c8c6;
10+
text-shadow: 0 1px rgba(0, 0, 0, 0.3);
11+
font-family:
12+
Inconsolata, Monaco, Consolas, "Courier New", Courier, monospace;
13+
direction: rtl;
14+
text-align: right;
15+
white-space: pre;
16+
word-spacing: normal;
17+
word-break: normal;
18+
line-height: 1.5;
19+
20+
-moz-tab-size: 4;
21+
-o-tab-size: 4;
22+
tab-size: 4;
23+
24+
-webkit-hyphens: none;
25+
-moz-hyphens: none;
26+
-ms-hyphens: none;
27+
hyphens: none;
28+
}
29+
30+
/* Code blocks */
31+
pre[class*="language-"] {
32+
padding: 1em;
33+
margin: 0.5em 0;
34+
overflow: auto;
35+
border-radius: 0.3em;
36+
}
37+
38+
:not(pre) > code[class*="language-"],
39+
pre[class*="language-"] {
40+
background: #1d1f21;
41+
}
42+
43+
/* Inline code */
44+
:not(pre) > code[class*="language-"] {
45+
padding: 0.1em;
46+
border-radius: 0.3em;
47+
}
48+
49+
.token.comment,
50+
.token.prolog,
51+
.token.doctype,
52+
.token.cdata {
53+
color: #7c7c7c;
54+
}
55+
56+
.token.punctuation {
57+
color: #c5c8c6;
58+
}
59+
60+
.namespace {
61+
opacity: 0.7;
62+
}
63+
64+
.token.property,
65+
.token.keyword,
66+
.token.tag {
67+
color: #96cbfe;
68+
}
69+
70+
.token.class-name {
71+
color: #ffffb6;
72+
text-decoration: underline;
73+
}
74+
75+
.token.boolean,
76+
.token.constant {
77+
color: #99cc99;
78+
}
79+
80+
.token.symbol,
81+
.token.deleted {
82+
color: #f92672;
83+
}
84+
85+
.token.number {
86+
color: #ff73fd;
87+
}
88+
89+
.token.selector,
90+
.token.attr-name,
91+
.token.string,
92+
.token.char,
93+
.token.builtin,
94+
.token.inserted {
95+
color: #a8ff60;
96+
}
97+
98+
.token.variable {
99+
color: #c6c5fe;
100+
}
101+
102+
.token.operator {
103+
color: #ededed;
104+
}
105+
106+
.token.entity {
107+
color: #ffffb6;
108+
cursor: help;
109+
}
110+
111+
.token.url {
112+
color: #96cbfe;
113+
}
114+
115+
.language-css .token.string,
116+
.style .token.string {
117+
color: #87c38a;
118+
}
119+
120+
.token.atrule,
121+
.token.attr-value {
122+
color: #f9ee98;
123+
}
124+
125+
.token.function {
126+
color: #dad085;
127+
}
128+
129+
.token.regex {
130+
color: #e9c062;
131+
}
132+
133+
.token.important {
134+
color: #fd971f;
135+
}
136+
137+
.token.important,
138+
.token.bold {
139+
font-weight: bold;
140+
}
141+
142+
.token.italic {
143+
font-style: italic;
144+
}

includes/assets/prism-atom-dark.min.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)