Skip to content

Commit 0f143c1

Browse files
fix: add horizontal scroller on middleware table to prevent overflow on the small screen
* fix(docs): add horizontal scroll wrapper to middleware diagram to prevent overflow on mobile (#1967) * fix(docs): replace mw-fig-scroll with table-scroller as per review feedback (#1967) * apply scroller width for same cross browser behaviour --------- Co-authored-by: shubham oulkar <[email protected]>
1 parent 120197a commit 0f143c1

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

css/style.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1211,6 +1211,7 @@ h2 a {
12111211
.table-scroller {
12121212
width: 100%;
12131213
overflow: scroll;
1214+
scrollbar-width: thin;
12141215
}
12151216

12161217
code {
@@ -1436,7 +1437,8 @@ h2 a {
14361437
padding: 0;
14371438
border: 0;
14381439
width: 960px;
1439-
margin-bottom: 20px;}
1440+
margin-bottom: 20px;
1441+
}
14401442
#mw-fig-imgcell {
14411443
margin: 0;
14421444
padding: 0px;

en/guide/writing-middleware.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ If the current middleware function does not end the request-response cycle, it m
2323

2424
The following figure shows the elements of a middleware function call:
2525

26+
<div class="table-scroller">
2627
<table id="mw-fig">
2728
<tr><td id="mw-fig-imgcell">
2829
<img src="/images/express-mw.png" alt="Elements of a middleware function call" id="mw-fig-img" />
@@ -41,6 +42,7 @@ The following figure shows the elements of a middleware function call:
4142
<div class="callout" id="callout6">HTTP <a href="/{{ page.lang }}/4x/api.html#req">request</a> argument to the middleware function, called "req" by convention.</div>
4243
</td></tr>
4344
</table>
45+
</div>
4446

4547
Starting with Express 5, middleware functions that return a Promise will call `next(value)` when they reject or throw an error. `next` will be called with either the rejected value or the thrown Error.
4648

0 commit comments

Comments
 (0)