Skip to content

Commit ffea6bc

Browse files
committed
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).
1 parent 753b3df commit ffea6bc

1 file changed

Lines changed: 14 additions & 8 deletions

File tree

styles/php85.css

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1939,7 +1939,9 @@ header nav {
19391939
border-color: var(--color-gray-200);
19401940
background-color: var(--color-white);
19411941
position: relative;
1942-
overflow: hidden
1942+
overflow: hidden;
1943+
display: flex;
1944+
flex-direction: column;
19431945
}
19441946

19451947
.code-container:where(.dark,.dark *) {
@@ -2051,13 +2053,17 @@ header nav {
20512053
height: calc(var(--spacing) * 4)
20522054
}
20532055

2056+
.code-container .phpcode {
2057+
flex: 1;
2058+
display: flex;
2059+
flex-direction: column;
2060+
}
2061+
20542062
.code-container pre {
2055-
min-height: 100%;
2063+
flex: 1;
20562064
font-size: var(--text-xs);
2057-
line-height: var(--tw-leading, var(--text-xs--line-height));
2058-
--tw-leading: var(--leading-loose);
20592065
line-height: var(--leading-loose);
2060-
white-space: pre-wrap;
2066+
white-space: pre;
20612067
display: flex
20622068
}
20632069

@@ -2070,7 +2076,7 @@ header nav {
20702076

20712077
.code-container code {
20722078
height: 100%;
2073-
padding: var(--spacing);
2079+
padding: 1.3125em;
20742080
color: var(--color-gray-400);
20752081
flex: 1;
20762082
overflow: auto
@@ -3550,8 +3556,8 @@ footer p:where(.dark,.dark *) {
35503556
color: var(--color-gray-400)
35513557
}
35523558

3553-
.php85 .phpcode {
3554-
padding: 1em;
3559+
.php85 .phpcode code {
3560+
white-space: revert;
35553561
}
35563562

35573563
.dark .php85 .phpcode::selection {

0 commit comments

Comments
 (0)