Author: Theodore Brown (theodorejb)
Committer: Derick Rethans (derickr)
Date: 2026-06-10T18:24:16+01:00

Commit: 
https://github.com/php/web-php/commit/517f6dd03bc26294f7de880582ebd3d0d9ec63b7
Raw diff: 
https://github.com/php/web-php/commit/517f6dd03bc26294f7de880582ebd3d0d9ec63b7.diff

Avoid wrapping PHP 8.5 release code blocks

This improves readability (particularly on smaller screens), since code blocks 
with overflow can be easily scrolled horizontally to read longer lines, rather 
than trying to visually parse code with line breaks in unintended places (which 
can even appear as invalid syntax when a line break is in the middle of a 
token).

Changed paths:
  M  styles/php85.css


Diff:

diff --git a/styles/php85.css b/styles/php85.css
index 6dea02089b..900a1a8ce0 100644
--- a/styles/php85.css
+++ b/styles/php85.css
@@ -1939,7 +1939,9 @@ header nav {
     border-color: var(--color-gray-200);
     background-color: var(--color-white);
     position: relative;
-    overflow: hidden
+    overflow: hidden;
+    display: flex;
+    flex-direction: column;
 }
 
 .code-container:where(.dark,.dark *) {
@@ -2051,13 +2053,17 @@ header nav {
     height: calc(var(--spacing) * 4)
 }
 
+.code-container .phpcode {
+    flex: 1;
+    display: flex;
+    flex-direction: column;
+}
+
 .code-container pre {
-    min-height: 100%;
+    flex: 1;
     font-size: var(--text-xs);
-    line-height: var(--tw-leading, var(--text-xs--line-height));
-    --tw-leading: var(--leading-loose);
     line-height: var(--leading-loose);
-    white-space: pre-wrap;
+    white-space: pre;
     display: flex
 }
 
@@ -2070,7 +2076,7 @@ header nav {
 
 .code-container code {
     height: 100%;
-    padding: var(--spacing);
+    padding: 1.25em;
     color: var(--color-gray-400);
     flex: 1;
     overflow: auto
@@ -3550,8 +3556,8 @@ footer p:where(.dark,.dark *) {
     color: var(--color-gray-400)
 }
 
-.php85 .phpcode {
-    padding: 1em;
+.php85 .phpcode code {
+    white-space: revert;
 }
 
 .dark .php85 .phpcode::selection {

Reply via email to