Skip to content

Commit 33e1c57

Browse files
authored
Merge pull request #141 from Carreau/mobile-hide
Hide buttons on smaller screens (mobile).
2 parents a9f5ba2 + 072a9ed commit 33e1c57

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 480px 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. 480px is a commonly used breakpoint to identify if a device is a smartphone. */
72+
73+
@media (max-width: 480px), (max-height: 480px) {
74+
div.try_examples_button_container {
75+
display: none;
76+
}
77+
}

0 commit comments

Comments
 (0)