Skip to content

Commit daec194

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 syntax with line breaks in unintended places (which can even appear invalid when a line break is in the middle of a token).
1 parent 13c77df commit daec194

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

styles/php85.css

Lines changed: 15 additions & 5 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

@@ -2071,6 +2077,7 @@ header nav {
20712077
.code-container code {
20722078
height: 100%;
20732079
padding: var(--spacing);
2080+
padding-bottom: calc(var(--spacing) * 2);
20742081
color: var(--color-gray-400);
20752082
flex: 1;
20762083
overflow: auto
@@ -3553,6 +3560,9 @@ footer p:where(.dark,.dark *) {
35533560
.php85 .phpcode {
35543561
padding: 1em;
35553562
}
3563+
.php85 .phpcode code {
3564+
white-space: revert;
3565+
}
35563566

35573567
.dark .php85 .phpcode::selection {
35583568
background-color: #333;

0 commit comments

Comments
 (0)