Skip to content

Commit a473be8

Browse files
committed
Hide buttons on smaller screens (mobile).
See #140, we might want to also add a warning dialog from Javascript as well in a subsequent PR.
1 parent dff6da7 commit a473be8

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

docs/directives/try_examples.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ Below is an example of the directive in use. The button has been styled with cus
77
css as explained in the configuration section below. Without custom css, the button will
88
be plain and unadorned.
99

10+
Note that as starting JupyterLite can download a significant amount of data, and
11+
that the Jupyter interface is not optimized for mobile, the buttons will be
12+
hidden on mobile by default (screen width 430px or smaller). This can be
13+
changed by overwriting with custom CSS.
14+
1015

1116
```rst
1217
Examples

jupyterlite_sphinx/jupyterlite_sphinx.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,14 @@
6464
@keyframes l13{
6565
100%{transform: rotate(1turn)}
6666
}
67+
68+
69+
70+
/* we do not want the button to show on smaller screens (phones), as clicking
71+
* can download a lot of data, 430px, is the width of iPhone 14 pro max */
72+
73+
@media (max-width: 430px) {
74+
div.try_examples_button_container {
75+
display: none;
76+
}
77+
}

0 commit comments

Comments
 (0)